Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^6: XML cleanup - regex or ?

by dHarry (Abbot)
on Sep 22, 2010 at 16:29 UTC ( #861311=note: print w/replies, xml ) Need Help??


in reply to Re^5: XML cleanup - regex or ?
in thread XML cleanup - regex or ?

I don't disagree with you, I didn't get what you mean by "XML error" and I'm afraid I still don't get it. If you mean that with "missing attributes" you can still parse the file because it remains "well formed" I agree. A XML parser can parse any wellformed XML document, otherwise it would not be compliant. Missing attributes won't make a difference. In order for a XML document to be wellformed you need at least a root element though. What got me on the wrong foot is that the OP mentions he knows what attributes to expect, I sort of assumed he has schema(s) and/or DTD(s) and therefore a validating parser. Validation is optional of course.

Replies are listed 'Best First'.
Re^7: XML cleanup - regex or ?
by ikegami (Pope) on Sep 22, 2010 at 16:47 UTC

    I'm afraid I still don't get it.

    He said he can't use an XML parser since he's getting XML parsing errors. If he correctly reported the problem, then he's mistaken. He's not getting XML parsing errors, so he can use an XML parser (as demonstrated). That's all I said.

    If he is getting XML parsing errors, then he misreported the problem in the OP. Crafting a regular expression would probably be the simplest solution, but we can't help him craft one without knowing what it should do.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://861311]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2018-07-17 02:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (353 votes). Check out past polls.

    Notices?