How to get XML parser to recognize entities (eg. —)
From: Kalessin (try_at_http://jesus.com.au/html/email/kalessin)
Date: 12/17/03
- Next message: Stijn Gabriels: "Re: Why Is The URL Affecting My Variables?"
- Previous message: SwissCheese: "Re: Upload *huge* files, is it wise with PHP ?"
- Next in thread: Andy Hassall: "Re: How to get XML parser to recognize entities (eg. —)"
- Reply: Andy Hassall: "Re: How to get XML parser to recognize entities (eg. —)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 17 Dec 2003 11:16:43 GMT
I'm using PHP's XML parser to validate user-entered XHTML fragments (I
wrap them in a top-level element and send them through the parser). It
works a treat, except for handling entities:
— -- is fine, but
— -- throws an error, e.g:
"XML error: undefined entity at line 11, char 415"
(Making an entity handler didn't help, at it fails at the parsing stage.)
Obviously I could search and replace to turn entities into their
character values, but that's pretty ugly. How can I get the XML parser
to recognize XHTML's entity set? Do I need to wrap the text fragment in
a full-blown XHTML document, including the DTD specifier?
Thanks in advance,
Kalessin.
- Next message: Stijn Gabriels: "Re: Why Is The URL Affecting My Variables?"
- Previous message: SwissCheese: "Re: Upload *huge* files, is it wise with PHP ?"
- Next in thread: Andy Hassall: "Re: How to get XML parser to recognize entities (eg. —)"
- Reply: Andy Hassall: "Re: How to get XML parser to recognize entities (eg. —)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]