• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Schema rules question (xsd file)

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this element defined:

<xsd:element name="validationLevel">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="full"/>
<xsd:enumeration value="basic"/>
<xsd:enumeration value="none"/>
<xsd:enumeration value="structure"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>


And I want to reference it twice within the same complex type. Is that possible? I'd like to reference the same enum with two different names so that two values can be sent down with the request if necessary. I realize that the setup below won't work but I'm hoping that there is a way to do this somehow.

<xsd:complexType>
<xsd:sequence>
<xsd:element name=??? ref="validationLevel" minOccurs="0"/>
<xsd:element name=??? ref="ValidationLevel" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
 
Shane Burgel
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok I think I figured it out. If I declare the enum as a simpleType without the element wrapper then I can reference it as a type in the response, so I was able to make two different values that reference the same enum. The only difference in my code is that now the enum looks like ValidationLevel.FULL instead of ValidationLevelType.FULL which should be fine I think.
 
Mo-om! You're embarassing me! Can you just read a tiny ad like a normal person?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic