tags:

views:

28

answers:

1

Hi,

I have an XML document which is to have the following tags:

 <step id="navigation">
      ...
 </step id="background">

 <step id="content">
  ...
 </step>

How do I make sure steps with ids of content, background, navigation, etc. appear in my document only once?

Right now I have

 <xs:element name="step" maxOccurs="1">
   <xs:complexType>
       .....
   </xs:complexType>
 </xs:element>

Thanks

+1  A: 

You should define unique key for your id attribute. Something like this:

<xsd:unique name="my_id">
  <xsd:selector xpath="//step"/>
  <xsd:field xpath="id"/>
</xsd:unique>
Superfilin