Hello,
I use Jena to read a RDF Model fra a PostgreSQL database, the Model has
a method write() that writes to an OutputStream.
I want to pass the content of that Model (what comes out of the write())
to the pipeline and display it in a template, jx.xml, using <jx:out
value="#{result-list}" xmlize="true"
xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"/>.
Now to the problem;
How do I keep that UTF-8 encoded output from Model.write() and pass it
on to the pipeline without getting:
"org.xml.sax.SAXParseException: Content is not allowed in prolog" when
trying to use a ByteArrayOutPutstream.toByteArray()
and
"org.xml.sax.SAXParseException: Invalid byte 2 of 3-byte UTF-8 sequence"
when using ByteArrayOutPutStream.toString()
It's vital that the UTF-8 encoding is kept, and Java String doesn't
support that.
Any ideas?
- Magnus
IMPORTANT NOTICE:
This message may contain confidential information.
If you have received this e-mail in error, do not use, copy or
distribute it. Do not open any attachments. Delete it immediately from
your system and notify the sender promptly by e-mail that you
have done so. Thank you.