From: Daniel S. <sh...@ir...> - 2003-08-29 16:55:22
|
I understand the need for the current semantic of --insert, but if I want to insert a node inside another node at the begining I need to do something like: xml ed -i "/node1/*[1]" -t elem -n "test" -v ... What if there is no node in node1? On the otherhand, subnode always adds at the end. I think we are missing something. I understand the need to refine the edit command, and I will try to think about how it should be implemented. Maybe I can give you some ideas. I agree that the edit feature should look alot like the sel feature. I think that edit could be a sel which is then inserted, appended etc... Why not have something like: xml ed .... sel .... We would evaluate the sel with exactly the select module and then paste/insert whatever the sel returned in the target XPath? I mean, for example incrementing an ID by one could also be implemented in the select module. There is no need for it to be only in the edit module? Daniel Shane -----Original Message----- From: xml...@li... [mailto:xml...@li...]On Behalf Of Mikhail Grushinskiy Sent: Friday, August 29, 2003 11:05 AM To: Daniel Shane; xml...@li... Subject: Re: [Xmlstar-devel] Great! insert - adds a node before selected node on same level append - adds a node after selected node on same level subnode - creates a child xml ed -i "/" -t elem -n "test" -v 5 does nothing. Actually command line options for 'edit' are not finalized. Some things are clearly missing. Ex. ability do add attributes together with element, ablility to modify nodes based on their current values. I pretty much realize what is missing, the main question is how to implement these missing functions so that it will be easir to use and it is still readable. I was also thinking about implementing 'edit' in similar approach to 'select' i.e. generate xpdate document based on command line options and implement xupdate see http://www.xmldb.org/xupdate/xupdate-wd.html ----- Original Message ----- From: "Daniel Shane" <sh...@ir...> To: <mgr...@co...>; <xml...@li...> Sent: Friday, August 29, 2003 10:05 AM Subject: RE: [Xmlstar-devel] Great! > 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 > > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.514 / Virus Database: 312 - Release Date: 8/28/2003 ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ xmlstar-devel mailing list xml...@li... https://lists.sourceforge.net/lists/listinfo/xmlstar-devel |