Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: creating an XML string

by steves (Curate)
on Dec 29, 2004 at 16:12 UTC ( #418008=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://418008]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2023-03-26 05:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (63 votes). Check out past polls.

    Notices?