Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Need help with this schema

From: "Jeremy Chapman" <please@------------->
To: NULL
Date: 8/1/2006 10:58:00 AM

I've got the following xml, and I'm trying to develop an xsd (below) to 
validate it. For the most part, my xsd is good, except I am having trouble 
accomodating the text after the Completed_By tag.  How can I do this?

<ns0:Assessment xmlns:ns0="http://AIM.xsd">
    <Location>ABC</Location>
    <Client>1234A</Client>
    <Client_Name>FRED SMITH</Client_Name>
    <Address>123 St, City Prov</Address>
    <City>CityName</City>
    <Province>AB</Province>
    <Postal_Code>LNL NLN</Postal_Code>
    <Telephone>555-555-5555</Telephone>
    <System>Assessment</System>
    <Type>Assessment</Type>
    <Date>28 JUN 06</Date>
    <Completed_By>UserName</Completed_By> Additional Text
    <Section Value="AA"> Additional text
        <Question Value="1.A"> Question text
            <Question_Text>Question text</Question_Text>
            <Answer_Text>Answer</Answer_Text>
            <Answer_Value>1</Answer_Value>
        </Question>
        <Question Value="1.B"> Question text
            <Question_Text>Question text</Question_Text>
            <Answer_Text>Answer</Answer_Text>
            <Answer_Value>1</Answer_Value>
        </Question>
     </Section>
     <Section Value="CC"> Referral Items
        <Question Value="1"> Question text
            <Question_Text>Question text</Question_Text>
            <Answer_Text>Answer</Answer_Text>
            <Answer_Value>1</Answer_Value>
        </Question>
    </Section>
</ns0:Assessment>


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:ns0="http://AIM.xsd" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://AIM.xsd" 
elementFormDefault="qualified" attributeFormDefault="unqualified">
 <xs:element name="Assessment">
  <xs:complexType>
   <xs:sequence>
    <xs:element name="Location" type="xs:string"/>
    <xs:element name="Client" type="xs:string"/>
    <xs:element name="Client_Name" type="xs:string"/>
    <xs:element name="Address" type="xs:string"/>
    <xs:element name="City" type="xs:string"/>
    <xs:element name="Province" type="xs:string"/>
    <xs:element name="Postal_Code" type="xs:string"/>
    <xs:element name="Telephone" type="xs:string"/>
    <xs:element name="System" type="xs:string"/>
    <xs:element name="Type" type="xs:string"/>
    <xs:element name="Date" type="xs:string"/>
    <xs:element name="Completed_By" type="xs:string"/>
    <xs:element name="Section" maxOccurs="unbounded">
     <xs:complexType>
      <xs:sequence>
       <xs:element name="Question" maxOccurs="unbounded">
        <xs:complexType>
         <xs:sequence>
          <xs:element name="Question_Text" type="xs:string"/>
          <xs:element name="Answer_Text" type="xs:string"/>
          <xs:element name="Answer_Value" type="xs:string"/>
         </xs:sequence>
         <xs:attribute name="Value" type="xs:string" use="required"/>
        </xs:complexType>
       </xs:element>
      </xs:sequence>
      <xs:attribute name="Value" type="xs:string" use="required"/>
     </xs:complexType>
    </xs:element>
   </xs:sequence>
  </xs:complexType>
 </xs:element>
</xs:schema>




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent