From: Daniel S. <sh...@ir...> - 2003-08-29 14:00:42
|
Hehe! I'm still too new to this tool to fully understand all the combinations. However, is it normal that the --insert inserts not "inside" the XPath but "outside" of it? Ex. xml ed -i "/xml" -t elem -n "test" -v 5 this will add test before xml and not inside it. Then what should xml ed -i "/" -t elem -n "test" -v 5 do? Daniel Shane -----Original Message----- From: mgr...@co... [mailto:mgr...@co...] Sent: Thursday, August 28, 2003 3:37 PM To: xml...@li... Cc: Daniel Shane Subject: RE: [Xmlstar-devel] Great! 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 > > |