[jdom-interest] FW: Trouble with Embedded HTML during XSLT Transformation

Blatt, Katie KBlatt at edmunds.com
Wed Jun 6 13:09:09 PDT 2001

Actually, 10 min. after sending this message, just solved my own problem
(FINALLY!!). In the XMLOutputter.java file, I commented out these lines in
the escapeElementEntities(String st) method:
                case '<' :
                    stEntity = "&lt;";
                case '>' :
                    stEntity = "&gt;";

May  not be an elegant solution, but seems to be working...

> -----Original Message-----
> From: Blatt, Katie 
> Sent: Wednesday, June 06, 2001 12:32 PM
> To: 'jdom-interest at jdom.org'
> Subject: Trouble with Embedded HTML during XSLT Transformation
> Hi all,
> I'm desperately seeking help with a problem I'm having with 
> an XSLT transformation using JDom.  I'm pretty new to 
> Jdom/XSLT/etc. and I'm not really sure if the problem is JDOM 
> or XALAN related.  Nonetheless, here goes:
> One of my XML elements has HTML text in it. I'm storing it as CDATA:
> <FullButton><![CDATA[<input type ="hidden" name="year" 
> value="2001"><input type ="hidden" name="make" 
> value="Volvo"><input type ="hidden" name="model" 
> value="S40"><input type ="hidden" name="trim" value="SE 4dr 
> Sedan (1.9L 4cyl Turbo 5A)">]]></FullButton>
> After I do the transformation, the "<" and ">" are all 
> transformed into &lt; and &gt;, screwing up the html 
> formatting.  I have spent all morning trying various fixes 
> that I have found on various message boards, including:
> * using disable-output-esacping="yes"- this just causes my 
> resulting HTML doc to have this declartion surrounding the 
> appropriate text: <?javax.xml.transform.disable-output-escaping?>
> * using <xsl:copy-of .../> instead of <xsl:value-of>
> * inserting a cdata-section-elements="//styleinfo/FullButton" 
>  element into the <xsl:output .../> declaration.
> I can't get anything to work.  I was searching around on 
> apache's Xalan site, and it looks like Xalan *SHOULD* process 
> this correctly.  So I'm wondering if it's something with 
> JDom?  For the most part, I am using the most recent Jdom 
> .java files from the CVS (as opposed to what's in the build 6 
> .jar file)- and I'm also using xalan.jar etc. from the Jdom 
> repository.
> Any advice is greatly appreciated!
> Katie
> kblatt at edmunds.com

More information about the jdom-interest mailing list