[jdom-interest] Help with xsl:text disable-output-escaping="yes"

Bradley S. Huffman hip at a.cs.okstate.edu
Wed Sep 11 18:12:09 PDT 2002


Would using javax.xml.transform.stream.StreamSource (included in JDK1.4)
instead of JDOMResult me your needs.

"Emmett McLean" writes:

> As Laurent asked ...
> 
> Any opinions or suggestions?
> 
> Thanks,
> 
> em
> 
> 
> 
> ---- Laurent Bihanic <laurent.bihanic at atosorigin.com> wrote:
> > Hi,
> > 
> > disable-output-escaping only applies when the XSLT processor outputs
> > the 
> > result as XML ou HTML. It does not apply when the output is a SAX event
> > flow 
> > as it is the case when you use JDOMResult.
> > JDOM receives a sequence of characters and, when requested to ouput
> > the 
> > document as XML, performs the escaping so that the output XML represents
> > the 
> > actual JDOM document content. In your case, this content is text.
> > 
> > The only way JDOM could reproduce Xalan behaviour would be for XMLOutputter
> > to 
> > interpret the <?javax.xml.transform.disable-output-escaping?> PI.
> > Opinions?
> > 
> > Laurent
> > 
> > 
> > Emmett McLean wrote:
> > > Hi,
> > > 
> > > It appears what disable-output-escaping works in xalan
> > > but not in JDOM. I wonder you know of a way to enable it?
> > > 
> > > I have an XSLT which works fine with an XML file if I
> > > do the transformation on the command line using xalan.
> > > 
> > > However, when I do the transform in JDOM the following code
> > > which works OK in xalan ...
> > > 
> > > <xsl:text disable-output-escaping="yes">
> > > <![CDATA[
> > > <style type="text/css">
> > > <!--
> > > body { font-family: Arial, Verdana, sans-serif; background-color:
> > #FFFFFF}
> > > -->
> > > </style>
> > > ]]>
> > > </xsl:text>
> > > 
> > > Gets rendered in JDOM as ...
> > > 
> > > <?javax.xml.transform.disable-output-escaping?>
> > > 
> > > <style type="text/css">
> > > <!--
> > > body { font-family: Arial, Verdana, sans-serif; background-color:
> > #FFFFFF}
> > > -->
> > > </style>
> > > 
> > > 
> > > In otherwords the disable-output-escaping tag fails.
> > > 
> > > I can email both the xsl and xml if someone would like to experiment.
> > > 
> > > Thanks,
> > > 
> > > em
> > 
> 
> -- 
> Emmett McLean
> emmettwa at onebox.com - email
> (866) 841-9139 x1160 - voicemail/fax






More information about the jdom-interest mailing list