Getting Failed nodes while validating XML against XSD

2 views
Skip to first unread message

swapofficial

unread,
Nov 9, 2014, 10:01:54 AM11/9/14
to newidea_or...@googlegroups.com
Hi Guys,

I need to get the failed node names along with some short description while validating xml against xsd.

I have tried creating "CustomErrorHandler" which catches SAXParserException when Validator validates the xml for given xsd. But the problem in here is that we are getting very long description of the failed nodes which looks like something as below.

org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'component'. One of '{"":component}' is expected. 

I am expecting only the name of node and the rule which was violated.

Is there any sort of api which can help?

Thanks,
Swapnil Desai

Javed Equbal

unread,
Nov 9, 2014, 1:47:16 PM11/9/14
to newidea_or...@googlegroups.com
Try the Java XML Validation API (javax.xml.validation.Validator) .

Thanks & Regards
Mohammad Javed Iqubal
Ph no: 91+9902343760


--
--
You received this message because you are subscribed to the Google
Groups "Technical Discussion" group.
To post to this group, send email to
newidea_or...@googlegroups.com
To unsubscribe from this group, send email to
newidea_or_techn...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/newidea_or_technical?hl=en

---
You received this message because you are subscribed to the Google Groups "Technical Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to newidea_or_techn...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

swapofficial

unread,
Nov 9, 2014, 1:55:34 PM11/9/14
to newidea_or...@googlegroups.com
I have tried that but it's giving very long and unreadable exception for business guys.... They just wanna know the node name and rule violator

If you are having any demo link please share it with me

Reply all
Reply to author
Forward
0 new messages