470,870 Members | 1,452 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,870 developers. It's quick & easy.

Adding XML to SAX stream?

Hello,
Seems simple enough in concept but I'm at a total loss. Basically I have a
WebRowSet that allows me to spit the XML out by using the .writeXml(Writer
w) method. What I need to do, is to add some additional XML at certain
locations within that rowset XML document. I think I know how to do this by
using DOM, but I want to use SAX for performance reasons. So basically I'd
like to pipe the WebRowSet output to a SAX parser so I can capture when
certain nodes are detected, append some of my own XML to the stream, then
pipe it to the XSL transformer.
So my WebRowSet might include something like the following...

<currentRow>
<columnValue>a</columnValue>
<columnValue>b</columnValue>
<columnValue>c</columnValue>
</currentRow>

.... but before hitting the XSLT transformer, I want it to look like.....
<currentRow>
<columnValue>a</columnValue>
<columnValue>b</columnValue>
<columnValue>c</columnValue>
<my_custom_node>my custom value</my_custom_node>
</currentRow>

... any ideas? Thanks!
Jul 17 '05 #1
1 1949
I think I've figured it out. I extended the sample at this URL to do what I
needed. So far so good. I'll try to remember to post an example here once
I've cleaned it up.

http://www-106.ibm.com/developerwork...er/?dwzone=xml

"Terry" <bogus@bogus> wrote in message
news:D-********************@4dv.net...
Hello,
Seems simple enough in concept but I'm at a total loss. Basically I have a WebRowSet that allows me to spit the XML out by using the .writeXml(Writer
w) method. What I need to do, is to add some additional XML at certain
locations within that rowset XML document. I think I know how to do this by using DOM, but I want to use SAX for performance reasons. So basically I'd like to pipe the WebRowSet output to a SAX parser so I can capture when
certain nodes are detected, append some of my own XML to the stream, then
pipe it to the XSL transformer.
So my WebRowSet might include something like the following...

<currentRow>
<columnValue>a</columnValue>
<columnValue>b</columnValue>
<columnValue>c</columnValue>
</currentRow>

... but before hitting the XSLT transformer, I want it to look like.....
<currentRow>
<columnValue>a</columnValue>
<columnValue>b</columnValue>
<columnValue>c</columnValue>
<my_custom_node>my custom value</my_custom_node>
</currentRow>

.. any ideas? Thanks!

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Tony Boloney | last post: by
2 posts views Thread by Husam | last post: by
20 posts views Thread by chance | last post: by
60 posts views Thread by Bill Cunningham | last post: by
2 posts views Thread by Marco Bizzarri | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.