in reply to Dealing with Malformed XML
Do something like this before passing your text to the XML parser?
But I think Re: Maximum parsing depth with XML::Parser? probably does a better job of this and implies the the greater-thans aren't a problem.s/&(\W|$)/&$1/g; s/<([^/\w]|$)/<$1/g; s/(^|\W)>/$1>/g;
I recall a module like this for HTML. It would find common mistakes (like unquoted attributes) and fix them. Something like that would be even more useful as a module for XML since the spec says to reject invalid input.
- tye (but my friends call me "Tye")
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (tye)Re: Dealing with Malformed XML
by Coyote (Deacon) on Jan 09, 2001 at 23:15 UTC |