Wednesday, 18 February 2015

XSD Validation Using Schema Issue



I have a xml file like



<root>
<requestId>1</requestId>
<subRequest>
<id>11</id>
<date>18-02-2015</date>
</subRequest>
<subRequest>
<id>12</id>
<date>19-02-2015</date>
</subRequest>
.
.
</root>


I have a XSD file which I cannot change and in that file the date have to be in some format. And there can be 1000 entries of "subRequest" tag. I created a schema validation to check the format.


So my problem is out of these 1000 entries, if there is only 2 entries whose date format is incorrect, how can I know id's of these 2 entries.


I am checking this when I am converting this xml into bean using JAXB(unmarshaller). I used schema validations and the validator.getLocalizedMessage() give null for both object and node. I can see only lineNumber and the general message about the issue format.


No comments:

Post a Comment