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

Re[2]: HTML entities

Subject: Re[2]: HTML entities
From: David Mitchell <dmitchell4@xxxxxxxxx>
Date: Thu, 23 Oct 2003 07:59:20 -0500
xsl html entities
>>  Now my HTML entities need to be
>>declared somewhere.  Is there a standard template
>>for this?

WP> I don't know of any "standard" way to pull HTML entities into your
WP> stylesheet, beyond simply pulling the relevant piece of the XHTML DTD in 
WP> and declaring it for your stylesheet. (And it wouldn't be a template; it'd 
WP> be a DTD module referred to in a DOCTYPE declaration for your stylesheet.)
<snip/>
WP> ...this is just so I don't have to memorize the funky Unicode points, but
WP> can use the named entity. But I don't bother with the entire HTML set -- 
WP> only with the entities I am actually likely to need in my stylesheet.

I agree with Wendell that the common practice is to declare the
handful that you need. But, you could include all of them by copying
these lines from the XHTML strict DTD and including them in your DTD
(or you could just use the XHTML strict DTD itself).

<!ENTITY % HTMLlat1 PUBLIC
   "-//W3C//ENTITIES Latin 1 for XHTML//EN"
   "xhtml-lat1.ent">
%HTMLlat1;

<!ENTITY % HTMLsymbol PUBLIC
   "-//W3C//ENTITIES Symbols for XHTML//EN"
   "xhtml-symbol.ent">
%HTMLsymbol;

<!ENTITY % HTMLspecial PUBLIC
   "-//W3C//ENTITIES Special for XHTML//EN"
   "xhtml-special.ent">
%HTMLspecial;

I've never actually done this. Wendall also makes a good point that
these declarations only let us use these "easy" names in our
stylesheet. The serializer will choose the output representation. For
XHTML output, a serializer would be correct to use a character
reference directly (either Hex or decimal). For HTML, I think it
would use the "easy" name of the entity reference.

--David Mitchell


 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.