Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XSL conversion with dbms_xslprocessor.processxsl & xsl:output

740956Dec 14 2009 — edited Dec 16 2009
Hello,
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 &amp; &gt; &lt; 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 13 2010
Added on Dec 14 2009
5 comments
3,225 views