Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Unfortunately XML::Checker::Parser is a bit buggy, and is known to not be a 100% correctly validating parser (I'm not sure what the fringe conditions are - it's changed developers recently, and hasn't been run through a validation suite to test it).

    As an alternative, try XML::LibXML's validating mode. It's based on libxml2 which is a validating parser, and known to be good and well tested. Yes, I'm biased, but I will admit there are some bugs in the validating code in XML::LibXML (not in libxml2).

    Also,
  • You can't use the Objects style if you have an element named "Characters" or any element has an attribute named "Kids" as they will clash with the builtin naming convention.

    It's probably best to use something like XML::XPath which wraps around XML::Parser. This creates a tree of objects with no reserved word problems and also lets you wander around using XPath which is a W3C standard, quite nice to use and knowing it could help you in lots of non-Perl situations too.
  • Good to know. I will look into XML::SAX::Simple and XML::XPath. Sounds like they are superior solutions!
  • I just think I need to mention that XML::Simple, while easy to use for config files and generally data-oriented XML, cannot be used for XHTML: it does not process mixed-content (<p>this is <b>mixed</b> content</elt>: text and tags mixed).

    If you want to process that kind of XML you will have to use either XML::Parser itself (XML::Simple is based on XML::Parser) or XML::Parser::PerlSAX or XML::XPath, or XML::Parser::PurePerl (which would make Matt _really_ happy ;--) or (of course!)

    --
    mirod
  • I was recently tasked with taking invalid xml (XML that is so broken that it was not even valid XML. ie missing closing tags, etc etc etc...). No DTD, no schema, no namespaces. So the search for an XML validator began.

    The XML contained critical medical information which is itself our companies cash-cow. Anyway, this stuff was totally ****ed and we needed to fix it so we could improve our current and quite legacy, hypercard, editorial system.

    Yes, hypercard in 2006.

    Anyway, the point is, that afte