[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

pesky & and fop

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

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

<snip>

 String value = "&#8226";
 Node root = doc.createElement("THEBIGONE");
 Text t = doc.createTextNode(value);
 root.appendChild(t);
 
</snip>


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

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

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-
escaping="yes"/></fo:block>

which to work properly with the fop needs to transform to

<fo:block>&#8226;</fo:block>

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

<fo:block>&amp;#8226;</fo:block>
 
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 
again.........

Cheers

Paul






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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.