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 http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
