XSL conversion with dbms_xslprocessor.processxsl & xsl:output
740956Dec 14 2009 — edited Dec 16 2009Hello,
I am converting an XML to an CSV via an XSLT. Every thing is working but not the conversion of some characters. The XSL contains <xsl:output method="text"/>, but if the XML contains specefic characters like & > < etc. they are not transfered to & < > like it shoul do.
Searching the forums I found some hints like this:
the most common error is that programmer's accidentally use:
DocumentFragment processXSL(xsl,xml)
instead of the:
void processXSL(xsl,xml,PrintWriter)
Only the latter gives the XSLT processor a chance to control the serialization and implement the <xsl:output> hints.
I am calling the function like this:
xsl := dbms_xslprocessor.newstylesheet(xsltdomdoc, '');
-- Get the new xsl processor instance
proc := dbms_xslprocessor.newProcessor;
-- Apply stylesheet to DOM document
outdomdocf := dbms_xslprocessor.processxsl(proc, xsl, indomdoc);
outnode := dbms_xmldom.makenode(outdomdocf);
I do not know, how to implement it with Printwriter.
Has anyone an idea?
Thanks