XSD Validation issue...

Status
Not open for further replies.

MongoMania

Ars Legatus Legionis
12,478
Hey guys,

Assume the following xml segment:
Code:
        <track-contributors>
          <contributor role="Artist">The Spidermen</contributor>
          <contributor role="FeaturedArtist"/>
          <contributor role="Songwriter">James Jonah Jameson</contributor>
          <contributor role="Publisher">Spiders Spiders Spiders!</contributor>
        </track-contributors>

the XSD:
Code:
<xsd:element name="track-contributors">
  <xsd:element name="contributor" maxOccurs="unbounded">
    <xsd:complexType>
      <xsd:simpleContent>
        <xsd:extension base="xsd:string">
           <xsd:attribute name="role" type="xsd:string" />
        </xsd:extension>
      </xsd:simpleContent>
     </xsd:complexType>
  </xsd:element>
</xsd:element>

Getting the following from http://www.corefiling.com/opensource/sc ... idate.html and from http://www.utilities-online.info/xsdval ... LT6H4fAd5A

Code:
s4s-elt-must-match.1: The content of 'track-contributors' must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*)). A problem was found starting at: element.

My head hurts like hell now after working with this for the past couple hours, was wondering if anyone sees anything painfully obvious that I'm just not seeing here.

Thanks in advance

PS: Used the following for example:
http://msdn.microsoft.com/en-us/library/ms256106.aspx
 

MongoMania

Ars Legatus Legionis
12,478
Nevermind, figured it out finally. I gave up caffeine and sugar yesterday. I'm so fucked.

for posterity and in case someone else comes up with a similar issue:
Code:
<xsd:element name="track-contributors">
 <xsd:complexType>
  <xsd:sequence>
   <xsd:element name="contributor" maxOccurs="unbounded">
    <xsd:complexType>
     <xsd:simpleContent>
      <xsd:extension base="xsd:string">
       <xsd:attribute name="role" type="xsd:string" />
      </xsd:extension>
     </xsd:simpleContent>
    </xsd:complexType>
   </xsd:element>
  </xsd:sequence>
 </xsd:complexType>
</xsd:element>
 
Status
Not open for further replies.