in reply to Parsing dodgy XML

Although you can work around this, the proper answer is to keep pushing back to the client to say "I will need an XML file from you... please let me know when you have an XML file".

Any file that is "mostly XML" is not XML. It's like being "mostly pregnant": there's no such thing.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^2: Parsing dodgy XML
by clinton (Priest) on Sep 20, 2006 at 15:38 UTC
    Likelihood of refusing bad XML tends towards zero as desperation to win new business tends towards infinity....

    I will be giving them an XSD and a small script to test validation, but if they (and 'they' are a national newspaper) use the current XML, then getting them to change it may prove difficult.

        They're the client; it's your job to make them happy. If they don't want to give you XML, they don't have to.

        If you want to get paid, you have to deal with what you're given, not what you wish you were given.