sequence and all usage issues

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • momotaro
    Contributor
    • Sep 2006
    • 357

    sequence and all usage issues

    Hi,

    Am writing an XSD file and am wanan use something like that:

    Code:
    <xs:element name="ENTITY">
    		<xs:complexType>
    			<xs:sequence>
    				<xs:element ref="FIELD" maxOccurs="unbounded"/>
    				<xs:element ref="ASSOCIATION" minOccurs="0" maxOccurs="unbounded"/>
    			</xs:sequence>
    			<xs:all>
    				<xs:element name="NAME"/>
    				<xs:element name="CODE"/>
    				<xs:element name="DESC"/>
    			</xs:all>
    			<xs:attributeGroup ref="EntityAtt"/>
    		</xs:complexType>
    	</xs:element>
    I know its not allowed but hope you got my idea if you know how to work this issue around please help!

    thank's in advance.
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    It'd be easier just to put the NAME CODE and DESC in a sub-element. Am trying to understand the rationale of requesting to do it in the way specified in your schema.

    Comment

    • momotaro
      Contributor
      • Sep 2006
      • 357

      #3
      when I write CODE before NAME I don't have the right to put NAME after that

      Comment

      • momotaro
        Contributor
        • Sep 2006
        • 357

        #4
        well can I now have one of my elements have the right to be used or not upon the existence of an attribute?

        <element name="blabla" yesOrNo="no">
        <element name="what">
        this element should not have the right to be out here because yesOrNo is set to no..?
        </element>

        Comment

        Working...