[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XT, HTML, and &nsbp;
Thanks Mike, Let me see if I understand this correctly: XML only defines five built-in entity references: &, <, >, ', and ". HTML40 defines many more (like ). In order to use HTML40 defined entity references in XSL documents (not source trees, but in XSL "scripts"), one must determine the underlying UCS character code, and use that code in a character reference ( ). The reason why XSL doesn't have something like: <xsl:entity-reference>nbsp</xsl:entity-reference> is that the result tree needs to contain the actual character being referenced, even though the resulting output will contain the string " ". The XSL processor has no idea what character is being referenced unless it parses the result namespace DTD looking for entity declarations, which it doesn't. So why not add these missing entity declarations to the stylesheet? I'm using XT and Sun's Project X non-validating parser and I now prefix my XML to HTML stylesheets with: <!DOCTYPE xsl:stylesheet SYSTEM 'Html40EntityDeclsForXml.dtd'> <xsl:stylesheet ... The Html40EntityDeclsForXml.dtd is just an XML version of the entity references section HTML40 DTD. This seems to add no more than a couple of milliseconds processing per stylesheet and let's me use any HTML40 entity reference right in my XSL without having to lookup the character code myself. (Yes, I'm that lazy!) -Ray 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
|