Subject: RE: multiple special characters in XML From: Mike Brown <mbrown@xxxxxxxxxxxxx> Date: Thu, 2 Sep 1999 10:13:12 -0600 |
> I can add <!ENTITY eacute "é"> to the XML > header. But then if they add something else cute tomorrow I > am stuck with bad XML again, until I add a new declaration. > I could add all possible declarations now and have huge XML > documents (We store 1000s of them) Alternatively I could > look for all the referenced entities and construct an appropriate > header for each document, which seems like a lot of overhead Well, the solution *must* be to declare those entities *somewhere* in your documents. The efficiency tradeoff may not be as bad as you think. It's only about 250 entity declarations with one character of replacement text per entity. Another listmember sent me this document a few months ago: http://www.skew.org/xml/misc_demos/Html40EntityDeclsForXml.dtd (view source if it doesn't show up in your browser) It seems to be derived from this section of the HTML 4.0 spec: http://www.w3.org/TR/WD-html40-970708/sgml/entities.html ...and a more XML oriented variation can be found in the XHTML 1.0 spec: http://www.w3.org/TR/1999/xhtml-modularization-19990406/module_defs.html#a_x html_character_entities However, none of these resources are appropriate for referencing directly at the URIs indicated -- my copy is unofficial and on a private web server, and the others are embedded in HTML documents. It would be inefficient to rely on network connectivity to be fetching the DTD from remote locations, anyway. If you don't want to explicitly declare the entities in every document, put the Html40EntityDeclsForXml.dtd file somewhere locally, then reference it from your XML and/or XSL documents like this (well, replace xsl:stylesheet with the document element as needed, and make sure the path/URI to the DTD is correct): <!DOCTYPE xsl:stylesheet SYSTEM "Html40EntityDeclsForXml.dtd" ]> This is the same as putting it in your documents, and introduces an inefficiency in that you need to access an extra file all the time. Your other option would be to use a post-processor to replace those named entities in the XML with their corresponding numeric references. -Mike XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: multiple special characters in , zun | Thread | Re: multiple special characters in , Tony Graham |
Re: Check the value of a element, David Carlisle | Date | Free beer and multiple special char, regan |
Month |