HTML entities in XML

admin

Administrator
Staff member
Hello all, this is my first post so very nice to meet you!

I have an XML file which contains html style entities like ™. I am adding a doctype to explain what the entities mean to the parser:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Although the file is technically xml not xhtml, everything is working fine and dandy in Mozilla and friends, but IE is throwing it's usual hissy fit. So I have been considering giving IE a separate doctype, an XSL stylesheet, through sniffing:
<!DOCTYPE xsl:stylesheet [
<!ENTITY % xhtml-lat1 SYSTEM
"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
<!ENTITY % xhtml-special SYSTEM
"http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent">
<!ENTITY % xhtml-symbol SYSTEM
"http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent">
%xhtml-lat1;
%xhtml-special;
%xhtml-symbol;
]>
This works, but I am a little concerned that the poor users of my site will have to download those entity definitions with every piece of xml, that is they don't seem to be cached.

So I guess my question is: is there an easier way to coax IE into accepting html entities in a piece of xml? Or can I cache those entity definitions on the user's machine somehow?

Thanks in advance!
 
Back
Top