Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: XML cleanup - regex or ?

by Utilitarian (Vicar)
on Sep 21, 2010 at 14:44 UTC ( [id://861083]=note: print w/replies, xml ) Need Help??


in reply to XML cleanup - regex or ?

It sounds as though you wish to verify that the XML conforms to a particular DTD specification.

XML::Rules looks like a good fit for your needs.

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Replies are listed 'Best First'.
Re^2: XML cleanup - regex or ?
by ethrbunny (Monk) on Sep 21, 2010 at 15:06 UTC
    The issue is that the file won't parse at all until I remove the noisy entries. I comb through it line by line looking for errors before I pass it to XML::Twig.
      It's not an XML error to be missing a meow attribute on a cat element. Did you misrepresent the problem, or are you actually getting the error when you validate the XML against a schema? There's no reason you can't do that after removing the offending elements.

        It's not an XML error to be missing a meow attribute on a cat element.

        That depends, if the attribute is mandatory it would be an error. Or do you mean something else by XML error? I'm thinking XSD here but I recall that with DTD's you can also specify attributes and make them "required".

        Cheers

        Harry

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://861083]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-25 19:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found