Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: From a folder, read all the XML files and add the end tag if not present.

by tobyink (Abbot)
on Nov 15, 2012 at 09:13 UTC ( #1003971=note: print w/ replies, xml ) Need Help??


in reply to From a folder, read all the XML files and add the end tag if not present.

It is a quick check and a quick fix with a text editor, and there are only 25 files.

Sometimes it's easier to just do it manually.

That said, if you have the xmllint command-line tool available (which is fairly standard, and packaged by almost every Linux distribution), then that should be able to tell you very quickly which files have errors:

xmllint --noout *.xml
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re: From a folder, read all the XML files and add the end tag if not present.
Download Code
Re^2: From a folder, read all the XML files and add the end tag if not present.
by Anonymous Monk on Nov 15, 2012 at 09:20 UTC

    Thanks tobyink, but there is more than 25 files (around 300 is there and cant do it manualy, I just mentioned 25 as a number.) Also I am working on windows, so I cannot use 'xmllint'. Pls can you suggest with a module or a program?

      Also I am working on windows, so I cannot use 'xmllint'

      Sure you can. Don't go looking to reinvent xmllint, go looking how to install xmllint

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2015-07-04 19:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls