From: <mgr...@co...> - 2003-08-28 19:45:55
|
Honestly I do not see much differences between element and attribute in that sense. (They are both nodes after all). Scenario you described can be achieved by combining multiple --insert, --append, --subnode which would look more natural and easier to read (I believe :)) --Mikhail > That works ok for attributes, but what if you want to update an XML node? In > that case would it be favorable to have multiple right hand side actions > before doing the affectation? In many cases the replacement is a > construction of elements rather than simply another part of the tree. > > Daniel Shane > > -----Original Message----- > From: xml...@li... > [mailto:xml...@li...]On Behalf Of > mgr...@co... > Sent: Thursday, August 28, 2003 2:54 PM > To: xml...@li... > Cc: Daniel Shane > Subject: RE: [Xmlstar-devel] Great! > > > Here is what was my original thinking on using XPATH expressions in r-values > for edit. > > Right now to update attribute value you would do something like > > xml ed -u //@id -v 2 > > //@id - points to a node being updated > 2 - specifies value (constant) > > > Here is how I would envision incremental update > > xml ed -u //@id -x "@id+1" > > //@id - points to a node/nodes being updated > and gives a context for xpath expressions > > @id+1 - specifies xpath expression within the context > defined in -u option. This expression evaluates > and its value is assigned to a node selected > in -u. > > Something like that... > > --Mikhail > > |