Allow an element with unlimited content

I want to add an element (settings) to my schema which has the following conditions:

1) Element is optional sub element of root
2) Element can have unrestricted content - including other xml nodes.
3) My document still needs to validate against the schema

Example document:
<root>
   <name>Test</name>
   <description>test</description>
   <conditionList>
        <condition id="1" mode="include">
            <List>
                   <code>1234</code>
                   <code>3452</code>
            </List>
       </condition>
        <condition id="2" mode="include">
            <List>
                   <code>1234</code>
                   <code>3452</code>
            </List>
       </condition>
   </conditionList>
   <settings>
       Optional content goes here - could be just a tring like this.  Or could be xml nodes.
   </settings>
</root>

Current Schema

<xs:element name="root">
     <xs:complexType>
          <xs:sequence>
            <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" />
            <xs:element name="description" type="xs:string" minOccurs="1" maxOccurs="1" />
               <xs:element ref="conditionList" minOccurs="1" maxOccurs="1" />
          </xs:sequence>
     </xs:complexType>
</xs:element>

<xs:element name="conditionList">
     <xs:complexType>
          <xs:sequence>
               <xs:element ref="condition" minOccurs="1" maxOccurs="unbounded" />
          </xs:sequence>
     </xs:complexType>
     <xs:unique name="uniqueConditions">
          <xs:selector xpath="condition"/>
          <xs:field xpath="@id"/>
     </xs:unique>
</xs:element>

<xs:element name="condition">
     <xs:complexType>
          <xs:sequence>
               <xs:element ref="List" minOccurs="1" maxOccurs="1" />
          </xs:sequence>
          <xs:attribute name="id" type="xs:string" use="required" />
     </xs:complexType>
</xs:element>

<xs:element name="List">
     <xs:complexType>
          <xs:sequence>
               <xs:element name="Code" minOccurs="0" maxOccurs="unbounded" />
          </xs:sequence>
          <xs:attribute name="mode" type="ModeOptions" use="required" />
     </xs:complexType>
</xs:element>

etc...
LVL 35
mrichmonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gertone (Geert Bormans)Information ArchitectCommented:
Hi mrichmon,

it could be this

    <xs:element name="settings">
        <xs:complexType mixed="true">
            <xs:sequence maxOccurs="unbounded">
                <xs:any processContents="skip"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

settings can contain mixed content
and a number of "any" elements
the content of these "any" elements will not be processed

hope this helps

Cheers!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mrichmonAuthor Commented:
I had to add the minOccurs to the settings

<xs:element name="settings" minOccurs="0" maxOccurs="1">
      <xs:complexType mixed="true">
            <xs:sequence minOccurs="0" maxOccurs="unbounded">
                  <xs:any processContents="skip"/>
            </xs:sequence>
      </xs:complexType>
</xs:element>

But that worked otherwise.

Thanks
Gertone (Geert Bormans)Information ArchitectCommented:
welcome
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.