Parsing error for schema file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JJadhav
    New Member
    • Jun 2008
    • 1

    Parsing error for schema file

    I have written the following schema file:
    [code=xml]
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:tns="http ://www.abc.com/DDSchema"
    targetNamespace ="http://www.abc.com/DDSchema"
    elementFormDefa ult="qualified"
    version="1.0">

    <complexType name="PSType">
    <element ref="tns:Profil eName" maxOccurs="unbo unded"/>
    </complexType>

    <element name="ProfileNa me" type="string"/>
    <element name="ProfilesS ummary" type="tns:PSTyp e"/>
    </schema>
    [/code]
    while parsing i am getting the following exception:
    [ERROR] s4s-elt-invalid-content.1: The content of 'PSType' is invalid. Element 'element' is invalid, misplaced, or occurs too often.

    I want to write the above schema for the sample xml:
    [code=xml]
    <ProfilesSummar y>
    <ProfileName>ca t</ProfileName>
    <ProfileName>do g</ProfileName>
    <ProfileName>ra t</ProfileName>
    </ProfilesSummary >
    [/code]
    Can someone please help? Thanks a lot !
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    The element inside the complexType needs to be nested inside of a sequence.
    [code=xml]
    <complexType name="PSType">
    <sequence>
    <element ref="tns:Profil eName" maxOccurs="unbo unded"/>
    </sequence>
    </complexType>
    [/code]

    Comment

    Working...