RE: [Xmltask-users] How to accumulate a buffer from multiple elements in a list?
Brought to you by:
bagnew
From: Karr, D. <dav...@wa...> - 2005-06-12 16:31:46
|
I haven't finished testing this yet, but it occurs to me that adding a "debug" or "print" subtask to print out buffers would be handy for debugging. > -----Original Message----- > From: Brian Agnew [mailto:br...@oo...]=20 > Sent: Sunday, June 12, 2005 9:03 AM > To: Karr, David > Cc: xml...@li... > Subject: Re: [Xmltask-users] How to accumulate a buffer from=20 > multiple elements in a list? >=20 >=20 > I would suggest (but haven't tried) using the insert task and the=20 > position=3D"after" attribute. Note that xmltask won't perform text=20 > appending, but is able to place text nodes after one another.=20 > Thus (in=20 > the DOM model) you'd get: >=20 > text node "stuff" > text node " " > text node "more stuff" >=20 > and on document output you should get what you want. >=20 > Brian >=20 > Karr, David wrote: >=20 > >I have two XML files. One I'm reading (call it "foo"), and=20 > the other=20 > >I'm reading and writing (call it "bar"). > > > >File "foo" has a "list" element like this: > > > > <list> > > <item>stuff</item> > > <item>morestuff</item> > > </list> > > > >As one of the things I have to do in "bar", I have to add an element=20 > >whose value is "stuff morestuff" (all of the "item" values=20 > concatenated=20 > >with a space between them). I tried to put together the=20 > pieces to do=20 > >this, but I'm not seeing how to do it. > > > >I thought perhaps this would require using the "copy" subtask with=20 > >append=3D"true", specifying a path that include all the list items. = I=20 > >wasn't sure what this would put between each value (probably=20 > nothing,=20 > >which would be a problem), but in any case, it didn't work=20 > at all. The=20 > >resulting value was only the first element in the list. It=20 > didn't get=20 > >anything past the first one. > > > >I also tried using a "call" subtask. This would send each=20 > value to the=20 > >target, but I'm not sure what I can do with the value at=20 > that point. I=20 > >tried using an xmltask with an anonymous sourcebuffer (just ".") and=20 > >writing to a buffer to accumulate the contents, but I got some error=20 > >about "Cannot use multiple buffer nodes as an input source". > > > > > >------------------------------------------------------- > >This SF.Net email is sponsored by: NEC IT Guy Games. How=20 > far can you=20 > >shotput a projector? How fast can you ride your desk chair down the=20 > >office luge track? If you want to score the big prize, get=20 > to know the little guy. > >Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 > >_______________________________________________ > >Xmltask-users mailing list > >Xml...@li... > >https://lists.sourceforge.net/lists/listinfo/xmltask-users > > > > =20 > > >=20 > --=20 > Brian Agnew http://www.oopsconsultancy.com > OOPS Consultancy Ltd brian @ oopsconsultancy.com > Tel: +44 (0)7720 397526 > Fax: +44 (0)20 8682 0012 >=20 >=20 |