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

RE: how to translate entities with XSL

Subject: RE: how to translate entities with XSL
From: Chris Purvis <ChrisP@xxxxxxx>
Date: Thu, 8 Jun 2000 11:19:11 -0700
chris purvis
Mike Brown wrote:

>> I have an XML document with HTML embedded within the element attributes.
>>  An example of one of the elements would be:
>> 
>> <row html="example output&lt;BR&gt;">

>Bad form. Use XHTML in the element content.

><row>
>  <xhtml>example output<br/></xhtml>
></row>

I know this is probably bad form, but this is the way I get the xml.  There
isn't an easy way to change this.


Kay Michael wrote:

>> I am trying to use XSL to insert these chunks of HTML into an 
>> HTML document, however, I cannot figure out how to get the entities 
>> translated back into "<" and ">".  Any ideas on how to do this? 

>disable-output-escaping. And if your XSL processor doesn't support it,
>switch to one that does.

disable-output-escaping works if the symbols aren't already escaped in the
xml itself.  For instance, if I use the following xml and xsl, I get: 

output test <br/> this should be on the next line 

instead of: 

output test 
this should be on the next line 


xml: 

<?xml version="1.0"?> 
<xml> 
    <data1> 
         <row detail="output test &lt;br/&gt; this should be on the next
line"/> 
    </data1> 
</xml> 


xsl: 

<?xml version="1.0"?>  
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">; 

 <xsl:template match="/"> 
   <xsl:value-of select="xml/data1/row/@detail"
disable-output-escaping="yes"/> 
 </xsl:template> 

</xsl:stylesheet> 


Thanks!

ChrisP

---------------
Chris Purvis
Programmer
415 Productions
chrisp@xxxxxxx


 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.