cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <>
Subject Re: String to bytestream?
Date Sat, 06 Sep 2003 07:12:51 GMT
On Fri, 2003-09-05 at 21:55, Timothy Larson wrote:
> How do you convert a string to a byte stream, such as
> XMLByteStreamCompiler.getSAXFragment() produces?
> All my attempts fail with
>   "org.xml.sax.SAXException: End of input reached."
> when the the byte stream is later interpreted.
> I am just trying to encode a text node.

I don't know what you've attempted so far, but I think the following
will work (warning: pseudo code):

XMLByteStreamCompiler comp = new XMLByteStreamCompiler();
String mytext = "piet snot";
comp.characters(mytext.toCharArray(), 0, mytext.length());
Object compiledSAX = comp.getSAXFragment();

Bruno Dumon                   
Outerthought - Open Source, Java & XML Competence Support Center                

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

View raw message