XML parsing inside XSP

2002-01-02 Thread Anton Jansen
Hi all, I want to be able to parse a java string to an xml representation in a XSP. Looking at the source code for the StreamGenerator (which takes a http-post stream) i have written the following code to parse a xml string in xsp: Parser parser = null; try {

Re: XML parsing inside XSP

2002-01-02 Thread Torsten Curdt
Hi all, I want to be able to parse a java string to an xml representation in a XSP. Looking at the source code for the StreamGenerator (which takes a http-post stream) i have written the following code to parse a xml string in xsp: Parser parser = null; try {

XML parsing in XSP

2002-01-02 Thread Anton Jansen
Hi all, I want to be able to parse a java string to an xml representation in a XSP. Looking at the source code for the StreamGenerator (which takes a http-post stream) i have written the following code to parse a xml string in xsp: Parser parser = null; try {

Re: XML parsing inside XSP

2002-01-02 Thread Anton Jansen
On Wed, 2 Jan 2002, Torsten Curdt wrote: Be careful. The above will break the XSP SAX structure. You need to think of the events: -xsp:startDocument -xsp:startElement -xsp:endElement - ... some more ... // now your code -parser:startDocument

Re: XML parsing inside XSP

2002-01-02 Thread Anton Jansen
Wrapp the page ContentHandler inside a org.apache.cocoon.xml.EmbeddedXMLPipe before passing it to the parser. -- Torsten Thanks Torsten, this is indeed the probleem and your solution works ! So the code I now have is (for later reference): Parser parser = null; try {

Re: XML parsing in XSP

2002-01-02 Thread David Rosenstrauch
Another option you can use to generate xml output from a string in an XSP page: Use util:include-expr. It will parse the text that you pass in to it, and generate SAX calls from it (as opposed to writing the text straight to the output - after escaping all the control chars - like it's doing