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

Re: Upper ASCII chars

Subject: Re: Upper ASCII chars
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 5 Feb 2002 07:35:02 +0000
oacute xslt
Hi Jay,

> I get the following in the file:
>
>    <param name="input1" 
> value="&pound;&copy;&reg;&Auml;&Euml;&Oacute;&aacute;&ouml;&yuml;.DTD">
>
> What I want, though, is:
>
>    <param name="input1" value="£©®ÄËÓáöÿ.DTD">
>
> Is there a way to achieve this?

It depends on what processor you're using. The XSLT 1.0 Rec states
that if the output method is html and the processor knows the
character entity reference for a character, then that character may be
output using the character entity reference, which is what you're
experiencing.

Some processors, notably Saxon (someone tell me if other processors
offer this) give you a bit of control over how you want the characters
to be serialized. With Saxon, you can do:

  <xsl:output method="html"
              saxon:character-representation="native;entity" />

to tell Saxon to serialize non-ASCII characters that can be serialized
as native characters in your character encoding as native characters,
and those that cannot be represented in your character encoding as
entities (if Saxon knows such an entity). This should give you the
result that you're after (assuming that the characters that you're
using are representable within your encoding).

[There's been a recent suggestion on xsl-editors@xxxxxx that a similar
functionality to saxon:character-representation be offered in XSLT 2.0
- you might want to post this example there to demonstrate another use
case.]

As an alternative, you could change the output method to xml and
generate well-formed HTML (or full XHTML if you want). The characters
won't be represented as entities in that case because XSLT 1.0
processors can't tell the difference between normal XML and
well-formed HTML, so won't escape any of the characters.

Out of interest, are you experiencing problems with browsers
recognising the character entity references, or is it purely that you
don't like the space that they take up, or find them less readable
than the native characters?

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.