• 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

How to skip part of xml from getting validated against xsd

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your line #24.

unless you want it otherwise.
 
kranthi chamarthi
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic