in reply to creating an XML string
Regarding XML and entities, someone may benefit from some knowledge I picked up:
- There is no need to declare numeric entities in order for them to parse okay with most (or maybe all) XML parsers. i.e., only named entities need to be declared. XML, of course, has three named entities pre-defined since they're so core: &, <, and >.
- You can pull in all standard HTML entities by using this
sort of DOCTYPE declaration:
<!DOCTYPE doc [ <!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent"> %HTMLlat1; <!ENTITY % HTMLspecial PUBLIC "-//W3C//ENTITIES Special for XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent"> %HTMLspecial; <!ENTITY % HTMLsymbol PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent"> %HTMLsymbol; ]>
I've found the above knowledge useful since so much of the XML I create is for the purpose of transmitting web based content, which includes HTML entities.
In Section
Seekers of Perl Wisdom