• 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

XSD validation error

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I try to validate the following schema in Altova XML Spy, it gives me validation error. The idea is - either [customerId & shipTo should be provided] or [orderdetails and billto should be provided]. But the XML instance can also provide the other elements optionally. So, a particular XML instance may have all the 4 elements -> cusotmerId, orderdetails, billto & shipto.

Any reason why is the schema not validating and what is the resolution?




Error
------
The schema doesn't appear to be valid by itself (as a part of another schema, it might still be OK).
'<xs:element name='customerId'>' makes the content model non-deterministic against '<xs:element name='customerId'>'. Possible causes: name equality, overlapping occurrence or substitution groups.
Error location: xs:schema / xs:complexType / xs:choice / xs:sequence / xs:element
Details
cos-nonambig: '<xs:element name='customerId'>' makes the content model non-deterministic against '<xs:element name='customerId'>'. Possible causes: name equality, overlapping occurrence or substitution groups.


--> 1 solution I had is define seprate elements for each of the choice group and declare it under ordertype. But this introduces a new element under "order". But this impacts the client code, if somebody has programmed according to the order of xml elements.

Any other way to have the xml structure as - no impact on client code with change in a valid schema



Thanks.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic