You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ch...@bluewin.ch on 2003/09/26 09:54:22 UTC
generating SAX events with a reader
Hi,
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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org