[jdom-interest]   not getting converted to  

Robert Taylor rtaylor at mulework.com
Thu Apr 22 13:00:01 PDT 2004


Greetings, I'm using JDOMBeta10 and am trying to transform an XML document into an HTML document.
I've chosen Xalan-Java v2.6.0 for transformation and have set the system property
javax.xml.transform.TransformerFactory with org.apache.xalan.processor.TransformerFactoryImpl as
discussed here:

http://www.jdom.org/docs/apidocs/org/jdom/transform/XSLTransformer.html

based on this documentation:

http://www.dpawson.co.uk/xsl/sect2/nbsp.html#d6353e246

it appears that there is an encoding issue.

I can use the same xml document and style sheet with "pure" Xalan classes
and the document is transformed as expected.

XML:
<?xml version="1.0"?>
<data>123456</data>

XSL:

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="html" indent="yes"/>

<xsl:template match="/">
<html>
<head></head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>

<xsl:template match="data">
This&#160;is&#160;some&#160;text&#160; <xsl:value-of select="."/>
</xsl:template>

</xsl:stylesheet>


JDOM output:
<?xml version="1.0" encoding="UTF-8"?>
<html><head /><body>
This is some text  123456</body></html>

Xalan output:
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
This&nbsp;is&nbsp;some&nbsp;text&nbsp; 123456</body>
</html>

Any ideas?

robert




More information about the jdom-interest mailing list