Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: XML file won't parse properly

by tinman (Curate)
on Apr 12, 2001 at 21:57 UTC ( [id://72119]=note: print w/replies, xml ) Need Help??


in reply to XML file won't parse properly

Coincidentally, I was talking about this sometime back on the chatterbox..

I got this snippet from tye, I think, who in turn said that jcwren had told him :o)

here goes.. in Perl, you can use regular expressions to match and strip characters..

$line =~ tr/\x80-\xff//d; $line =~ tr/\x00-\x1f//d; $line =~ s/[\r\n\t]//d;

The first two lines strip high end control characters from your file and the third line replaces all whitespace and new line characters..

for more information on what this is, and how its done, I'd suggest you look at this page..
HTH Update: fixed the regexps.. many thanks to chromatic

Log In?
Username:
Password:

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

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

    No recent polls found