Jump to content

Allow elements to be unbounded without requiring a sequence?

Recommended Posts

I want to allow several elements to be unbounded, but I don't need them to be in a particular order.

<xs:sequence>  <xs:element ref="Duration" minOccurs="1" maxOccurs="1" />      <xs:element ref="ScriptURL" minOccurs="1" maxOccurs="1" />  <xs:element ref="StimulusSignal" minOccurs="0" maxOccurs="unbounded" />  <xs:element ref="FreeNode" minOccurs="0" maxOccurs="unbounded" />  <xs:element ref="ProtectedNode" minOccurs="0" maxOccurs="unbounded" />                <xs:element ref="ExclusiveNode" minOccurs="0" maxOccurs="unbounded" />                      </xs:sequence>

I can't use <all>, since that wouldn't allow them to be unbounded. Is there a way to allow them to be in any order? Or is it considered preferable to require elements to be in a fixed sequence? It's not a major problem; I'm just trying to figure out best practices. I appreciate any clarification you can provide.

Share this post

Link to post
Share on other sites

Your code is correct. Only you have to remove <sequence> tag to achieve your result. By removing <sequence> tag, you can structure those elements in any order within particular element.nJoy coding...Always!!!

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...