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

RE: need help with xhtml output

Subject: RE: need help with xhtml output
From: Jarno.Elovirta@xxxxxxxxx
Date: Wed, 4 Jun 2003 11:28:45 +0300
javascript xhtml xml
Hi,

> 1. Outputting character entities.
> 
> There doesn't seem to be an easy way to output "©" (in 
> attributes)
> and other numeric entities. © is unchanged, © 
> becomes the
> (c) character itself. For instance, I want to output exactly 
> this sequence
> of characters:
> 
> <meta name="copyright" content="&#169; 2003"/>

Why? It will make no difference to the program reading your document whether it's a character or a character reference. Anyhow, you could set the xsl:output to use encoding "ASCII" (provided your XSLT engine recognizes that encoding) to force non-ASCII characters to be output as character entities.

> 2. Forcing a close tag for elements
> 
> Mozilla, Opera and IE choke on <script/>.

If you serve you XHTML documents as application/xhtml+xml, Mozilla's probably happy with <script/>.

> Textarea is another one.
> The trick to do "<script><xsl:text>
> </xsl:text></script>" seems like such a hack. Is there a better way?

Not a better one, but you can also use e.g.

  <script type="text/javascript" src="foo.js">//</script>

or

  <script type="text/javascript" src="foo.js">
    <xsl:comment />
  </script>

> 3. html namespace attribute.
> 
> Consider this:
> 
> <html xmlns="http://www.w3.org/1999/xhtml">
>    <head>
>       <xsl:call-template name="headers"/>
>    </head>
> </html>
> 
> All the elements that the template headers inserts get an extraneous
> xmlns="" attribute. What is the best way to deal with that?

Well, different XSLT engines might handle it differently, but you could try declare the XHTML namespace in the xsl:stylesheet instead of the Literal Result Elements, and then not copy/generate the namespace nodes.

Cheers,

Jarno - Skinny Puppy: Nature's Revenge

 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.