• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Get specific error message in xml validation with xsd

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using XSD schema to validate the XML String. I am able to validate the XML against XSD schema, but while validating the XML i am getting the SAXException messages as below

cvc-maxExclusive-valid: Value '23123132321323123123213' is not facet-valid with respect to maxExclusive '999999999999999' for type 'MerchantTrackIdType'.
cvc-type.3.1.3: The value '23123132321323123123213' of element 'MerchantTrackId' is not valid.

Here i am implementing the ErrorHandler(MyErrorHandler) class and getting the above exception messages. But to give exact error response to out i wish to get the only
The value '23123132321323123123213' of element 'MerchantTrackId' is not valid.



I googled out for getting the only cvc-type message from SAXException, Please help me in this regards if you found any solution.

Thanks in advance.
 
shiva kumar g
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Anyone please help me for the above issue. I am still working/searching on the same but no use. Any solutions for the same is greatly appreciated.

Thanks.
 
Ranch Hand
Posts: 734
7
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The bare minimal to establish the "localized message" from within the ErrorHandler can be this (or some variants you can think of).

You can conceive a scheme to collect and to store the messages from within the handler and construct a method (called getLocalizedMessage() or whatever) to return the complete messages to the caller. It is up to you to do.
 
shiva kumar g
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi g tsuji,

Thanks for your reply. I will try to get resolve my issue.

 
This guy is skipping without a rope. At least, that's what this tiny ad said:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic