• Post Reply Bookmark Topic Watch Topic
  • New Topic

Schema rules question (xsd file)

 
Shane Burgel
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!