Hi, Brian
-----Original Message-----
From: Brian Agnew [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 10, 2007 3:02 PM
To: Ant Users List
Cc: [EMAIL PROTECTED]
Subject: Re: xmltask xpath bug ?!, buffer to property ?!
/*
(note: there's an XMLTask mailing list
[EMAIL PROTECTED]
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]