How to validate large number of XML-files filtered from project?

I need to validate XML files for XSD-schema conformance. And "one-by-one" validation is not an option, cause I have hundreds of XMLs.

I tried to use "Analyze/Inspect Code" with custom inspection profile. I thought that "XML / File does not pass external validation" inspection should do the trick, but "Analyze" returns 0 results for this inspection (and I inserted bad code in XML before analysis for test purpose).

I'm using IDEA version: IU-107.535

2 comments
Comment actions Permalink

For me it will be better to write simple test instead. If you have a huge xml set it will save your time shortly. Can confirm, that inspection broken for me too.

regards, Alex

0
Comment actions Permalink

Actually, looks like my problem doesn't depends on number of XML's.
I attached very simple project with one XML and one XSD which reproduces problem every time.

About this project:
I added this line to "Settings > Resources": URI - http://www.example.com/xsd-xml-test and Path - path to "schema.xsd" in this project.

Single file validation from right click works fine. Produces 3 error messages:
cvc-datatype-valid.1.2.1: '2011-01-55' is not a valid value for 'date'.
cvc-type.3.1.3: The value '2011-01-55' of element 'some_date' is not valid.
cvc-complex-type.2.4.d: Invalid content was found starting with element 'some_date'. No child element is expected at this point.

But "Analyze > Inspect Code..." said "No suspicious code found".  I exec inspection on "Whole Project" and all XML inspections in profile was checked.

PS: I have one strange behaviour with inspections which could be related to this issue.
When I tried to use "Analyze > Run inspection by name" I couldn't find "File does not pass external validation" inspection in the list.
Attached screenshot of list - file "Find_inspection_by_name.png".

PPS: Tested with IDEA 10.5.1 - same result.



Attachment(s):
Find_inspection_by_name.png
xsd-xml-test.zip
0

Please sign in to leave a comment.