Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to skip part of xml from getting validated against xsd

 
kranthi chamarthi
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am preparing an xsd to validate input xml to a tool. Now I need only some of the elements to be validated against xsd and some to be skipped. For example i have below xml to be validated

Now i want my xsd to validate until Input element and to skip Order and its children(in bold above).
I tried googling and found something called xs:any element which can be used with processContents="skip"
I tried using it in below way in my xsd

But when i run my java class that validates above xml with my xsd, it shows

Any suggestions on this will be helpful.

Regards
Kranthi
 
g tsuji
Ranch Hand
Posts: 656
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The fragment of schema shown cannot determine why that specific error occurs at all, rather it shouldn't occur.

The only problem that can turn up is of another kind. It is that if the xs:element for Input as shown is of global scope, it is erroneous. It can only appear as such in local scope. However, if not, the error is of a different nature not what the question is pointing to.

Hence, you have to show more to determine why.
 
kranthi chamarthi
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The xml that i am trying to validate is something like below


and the xsd i am using is like below


I dont want the Order xml present under Input element to be validated against xsd. Please suggest.

Regards,
Kranthi
 
g tsuji
Ranch Hand
Posts: 656
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your line #24.

unless you want it otherwise.
 
kranthi chamarthi
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks g tsuji . I overlooked the point that i should specify processContent as skip for Template as well.... Its working now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic