[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: how to translate entities with XSL
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<BR>"> >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 <br/> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|