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

RE: Escape caracters

Subject: RE: Escape caracters
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Fri, 28 May 2004 11:55:38 -0400
escaping html in xsl
> From: SMITH Neil [mailto:neil.smith@xxxxxxxx] 
> This is the XSL
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 
> <xsl:template match="/">
> 
> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; 
> charset=UTF-8"/> <html> <body>
> 
> <xsl:apply-templates select=".//RR_row"/>
> 
> </body>
> </html>	
> </xsl:template>
> 
> etc...
> 

As David Carlisle has just posted, this produces invalid HTML.  Also, do
you intend to be producing *XHTML* or *HTML*?  You are doing neither
right now.

To expand on what David said about doubled escaping, he means that the
ampersand in the character references is itself escaped with & a m p ;.
Thus the things that look like character references are only text, and
the browser shows them just as the output file specifies.

Assuming that you want to generate real HTML, you do not have to put
your own meta element in, the processor will do it if you simply use an
xsl:output element to say what the encoding is and that you want html
output.  Normally, the processor wouuld create html by default when it
notices the html element, but in this case, you start with a meta
element, and that apparently has prevented the processor from realizing
what you want.  

The only reason you are getting anything viewable in the browser is
because browsers are so very tolerant of junk.

Cheers,

Tom P

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.