Validating large xml files

A ready-to-use Python script would then look something like this: I always recommend the XML Starlet command line utilities.

They provide validation, querying, formatting, editing of documents straight from the command line, and they're invaluable for this sort of work, or sanity-checking documents, chopping sections out via XPath etc.

I'm not bothered about validation against an XSD, just want to know if the XML is well-formed.

This will show the problem, and is quite performant.

You can browse and search the entire file and return to the error at any time, instantly, using the bookmark, to fix and save it when you are ready.

If, two line numbers are reported in the error message, both are bookmarked.

Refer to the online help for more details on this topic.

Also check out our article that explains the difference between schema errors and well-formed errors and the one on XML parsers.

This saves time by not having to re-parse the XML after it is in the treeview.

Either way, the entire file is validated and all validation errors are shown in a results list that is bookmarked for instant navigation to any of the errors at any time, even after making edits and saving the file. If you do not need to fix the validation errors, the read-only text viewer offers a faster way to perform validation.

I was using this extension method to transform very large xml files with an xslt.

Tags: , ,