[xsl] pesky & and fop

Subject: [xsl] pesky & and fop
From: "eoin walsh" <paul5@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 9 Oct 2002 17:45:45 +0100

I'm trying to dynamically insert some special characters (bullet point for 
example - &#8226;) into a pdf produced using xsl + fop.

The XML input is built  using something like


 String value = "&#8226";
 Node root = doc.createElement("THEBIGONE");
 Text t = doc.createTextNode(value);

So, I have an xml document with the node above. This is then transformed 
using xalan-2.0.0.jar with...

 Transformer transformer = tbf.newTransformer(new StreamSource(xslfile));
 DOMResult domResult = new javax.xml.transform.dom.DOMResult();
 transformer.transform(new javax.xml.transform.dom.DOMSource
 // Now you can get the output Node from the DOMResult.
 Document result = (Document) domResult.getNode();

and sent off to the fop processor for conversion to PDF. Ok so far.

The xsl stylesheet contains

<fo:block><xsl:value-of select="THEBIGONE" disable-output-

which to work properly with the fop needs to transform to


Unfortunately the & in the xml node gets further escaped in the 
transformation to 

So in the PDF instead of a bullet point I see &amp;#8226;

As you can see I've set the disable-output-escaping="yes" attribute in the 
stylesheet. Not only have I read that this isn't really a good idea (with 
evil overtones of GOTO) but it doesn't even seem to do the trick.....

I've also played with encoding types and gludgey entity substitutions with no 
luck. Any advice/direction (even it's "it can't be done") would make work fun 



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread