aspose file tools*
The moose likes XML and Related Technologies and the fly likes How to skip part of xml from getting validated against xsd Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to skip part of xml from getting validated against xsd" Watch "How to skip part of xml from getting validated against xsd" New topic
Author

How to skip part of xml from getting validated against xsd

kranthi chamarthi
Ranch Hand

Joined: May 08, 2007
Posts: 95
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

Joined: Jan 18, 2011
Posts: 535
    
    3
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

Joined: May 08, 2007
Posts: 95
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

Joined: Jan 18, 2011
Posts: 535
    
    3
Your line #24.

unless you want it otherwise.
kranthi chamarthi
Ranch Hand

Joined: May 08, 2007
Posts: 95
Thanks g tsuji . I overlooked the point that i should specify processContent as skip for Template as well.... Its working now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to skip part of xml from getting validated against xsd