in reply to Re: Valid XML and XML::Simple
in thread Valid XML and XML::Simple

Hi,
I'm assuming this is not black and white, but the fact is that if you save my example as an XML file, and try to open it, you get an error. It also fails when I try to parse it in "C".

Replies are listed 'Best First'.
Re^3: Valid XML and XML::Simple
by erroneousBollock (Curate) on Oct 28, 2007 at 13:06 UTC
    The foo:thing syntax relates to namespaces. An XML parser must accept such syntax (here the node is a 'thing' in the 'foo' namespace).

    The document should be considered invalid because the 'person' namespace has not been declared at the top of the XML document.

    However, XML::Simple is (as it's name implies) a simplistic approach to parsing XML... it's not exactly a strict parser. It may or may not give you a warning about a missing 'prefix'.

    Use a more compliant parser such as XML::Parser (directly), XML::Twig or XML::LibXML.

    -David