Hi Gilbert, Thx for feedback etc. If you're getting a 'multiple nodes' issue then you're probably pasting something like:
<a/> <a/> <a/> into a blank document (has no root node). The attribute "append" has to be used to add new nodes into a buffer (and possibly a property). There are problems with properties viz. char encoding and the like, so the emphasis in XMLTask is now on using buffers (which are DOM fragments, as opposed to strings). I understand your ','-separated requirement. However I don't believe XMLTask will support that anytime soon. If XMLTask doesn't support "append" on properties, then it probably should do. At some further stage, I think the "append" should be a default. It's a historical/backwards compatibility issue (ISTR)that it's defaulted to "false". Brian On Tue, July 10, 2007 14:29, Rebhan, Gilbert wrote: > Hi, Brian > > -----Original Message----- > From: Brian Agnew [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 10, 2007 3:02 PM > To: Ant Users List > Cc: xmltask-users@lists.sourceforge.net > Subject: Re: xmltask xpath bug ?!, buffer to property ?! > > /* > (note: there's an XMLTask mailing list > xmltask-users@lists.sourceforge.net > which is more suitable for XMLTask-specific messages, but...) > */ > > normally i have no problems with xmltask ;-) but thanks for the pointer > > /* > I will have to check on property appends vs. buffer appends and what's > expected to work. > */ > > i expect the whole nodelist in the property when there is more than 1 > match > would be nice to have all matches (nodelist) as separated list, and > the separator may be set as attribute ( default ' , ' ) > > /* > Buffers are a better thing to copy/paste into (for many reasons I won't > go > into here). You can copy from a buffer to a property. Probably by doing > something like (warning - this is untested!) > > <xmltask sourcebuffer="your buffer name"> > <copy path="/" property="your property name"> > .... > */ > > i tried that, but that gave me = > [xmltask] Cannot use multiple buffer nodes as an input source > [xmltask] at > com.oopsconsultancy.xmltask.ant.XmlTask$InputBuffer.getDocument(XmlTask. > java:254) > [xmltask] at > com.oopsconsultancy.xmltask.ant.XmlTask.execute(XmlTask.java:653) > > seems like a problem when there are more matches ?! > > /* > or similar. Perhaps you can forgo the additional <xmltask> invocation by > creating a dummy node in your real doc, pasting into that, copying into > a > property and then deleting the dummy node ? > */ > > i just need to pull out several parts of a xmlproperty file and dump it > to a txtfile > as input for a shellscript so it's no editing of a xmlpropertyfile > > If nothing else works i'll go via <script> task with ruby, here i get > all nodes as > array, i.e. = > > require "rexml/document" > include REXML > ... > names = XPath.match( doc, "//module/*/name") > File.open("Y:/demo.txt", "a") { |f| > names.each { |mname| f.print mname.text+"\r\n"} > } > > > Regards, Gilbert > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Brian Agnew http://www.oopsconsultancy.com OOPS Consultancy Ltd Tel: +44 (0)7720 397526 Fax: +44 (0)20 8682 0012 ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Xmltask-users mailing list Xmltask-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xmltask-users