cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject generating SAX events with a reader
Date Fri, 26 Sep 2003 07:54:22 GMT

I have a table containing xml data. The xml data is stored as text (clob)
datatype (sybase..)
I'm using cocoon 2.1

Now i want to generate SAX events when out of this xml data. I need to to
this in a cocoon Generator.

So I have something like

Reader reader = resultSet.getCharacterStream(1);
Now how can i generate SAX events?
I've tried several things:

-> create a new XMLReader and parse it like :
xmlReader.setContentHanlder(super.contentHandler); // this is the one cocoon
is using
xmlReader.parse(new InputSource(reader);

I thought this must work but it does not! When displaying it as xml it is
fine, but when i pass it through an XSL it does unexplainable things.. ;-)

-> the secon thing I tried

String xmlText = rs.getString(1); // get the whole xml as a string
SourceUtil.parse(super.manager, new StreamSource(new ByteArrayInputStream(xmlText.getBytes())),super.xmlConsumer);

StreamSource is a custom class that just takes an InputStream and returns
it when requested.

this works fine but I don't like this workaround.. there must be another
way to generate SAX events?!

I hope it's understandable what I wrote ...

Thanks for any ideas.. 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message