Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Validator Please?? 2

Status
Not open for further replies.

qajussi

Programmer
Mar 22, 2004
236
US
Hi!

I am looking for XML validator for a folder containing very large files.
I found a few validator which can do one file at a time.
But I need something easy to use and run on a folder.

I have about 20,000 XML files.
I know some of files have ">,<,&" signs in the file.
I need to find those files and correct them.

Do you know any XML validator which will run on a folder containing xml files???
Thanks millions
 
sounds like the best thing to do is to write your own in vbscript or something using msxml

should be faily simple to read in a file at a time and use MSXML4.0 to validate the xml, catching the errors when the parser loads the file and printing out the filename...


Matt

 
If that's the only problem (and you're on unix) use a sed script to handle the entities (omit the spaces in this code):
Code:
/\&/s//\& amp;/g
/\</s//\& lt;/g
Wrap it up in a shell script to iterate over all the files in the folder.
 
Thanks Guys.

I am on Windows.
I will play around with the VBScript later.
So there are no XML validators out there??
 
Oops! For anyone else who might see this, I neglected to mention that the above sed script assumes you have plain text that you're attempting to convert to XML. If you're starting with XML that has stray entities, this would just compound the problem. Sorry.
 
Yes.. I looked but can't find one that handles a folder containg xml files..

Thanks very much for your input.


 
Ok, furthermore, you seem to be confusing the concepts of a document being well-formed (syntactically correct) and valid (conforming to a given schema or DTD.) You don't need a validator. Yours is a syntax problem. Any XML parser will complain about syntax problems.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top