Jump to content

XSD Schema - problem


pabloxerr

Recommended Posts

hello Guys! I've just started my adventure with XML and XSD Schema and that's why I cannot solve this problems. And I've got a question: Can You help me? Please! That's my XML document: <?xml version="1.0" encoding="utf-8"?> <!-- Jako przedmiot mojej kolekcji wybrałem filmy. Wybrałem akurat te ponieważ należą do moich ulubionych. --> <mycollecion><owner:email xmlns:owner="kempa.tomas@gmail.com"><name>name</name><surname>surename</surname><age ######="mezczyzna">19</age><town originCountry="Polska">Łańcut</town><studyField semester="pierwszy">Informatyka Stosowana</studyField><deansgrupe>KrDZIs1012</deansgrupe></owner:email><uek:copyright xmlns:uek="http://uek.krakow.pl/">Wydział Zarządzania, Uniwersytet Ekonomiczny, Kraków</uek:copyright><films><Transporter><year lenght="1h 32min">2002</year><type>Akcja</type><production premiere="27 grudnia">Francja,USA</production><direction screenplay="Luc Besson,Robert Mark Kamen">Corey Yuen,Louis Leterrier</direction><assigment>dobry</assigment> </Transporter><ForrestGump><year lenght="2h 22m">1994</year><type>Dramat,Komedia</type><production premiere="4 listopada">USA</production><direction screenplay="Eric Roth">Robert Zemeckis</direction><assigment>rewelacyjny</assigment> </ForrestGump><Matrix><year lenght="2h 16min">1993</year><type>Akcja,Sci-Fi</type><production premiere="13 sierpnia">AustraliaUSA</production><direction screenplay="Andy Wachowski,Lana Wachowski">Andy Wachowski,Lana Wachowski</direction><assigment>bardzo dobry</assigment></Matrix><Avatar><year lenght="2h 42min">2009</year><type>Sci-Fi</type><production premiere="25 grudnia">USA,Wielka Brytania</production><direction screenplay="James Cameron">James Cameron</direction><assigment>bardzo dobry</assigment></Avatar><Gladiator><year lenght="2h 35min">2000</year><type>Dramat historyczny</type><production premiere="14 lipca">USA,Wielka Brytania</production><direction screenplay="David Franzoni,John Logan,William Nicholson">Ridley Scott</direction><assigment>bardzo dobry</assigment> </Gladiator><Titanic><year lenght="3h 14min">1997</year><type>Melodramat,Katastroficzny</type><production premiere="1 listopada">USA</production><direction screenplay="James Cameron">James Cameron</direction><assigment>dobry</assigment> </Titanic><Inception><year lenght="2h 28min">2010</year><type>Surrealistyczny,Thriller,Sci-Fi</type><production premiere="8 lipca">USA,Wielka Brytania</production><direction screenplay="Christopher Nolan">Christopher Nolan</direction><assigment>bardzo dobry</assigment> </Inception><FastFive><year lenght="2h 10min">2011</year><type>Kryminał,Akcja</type><production premiere="15 kwietnia">USA</production><direction screenplay="Chris Morgan">Justin Lin</direction><assigment>dobry</assigment> </FastFive><Taken><year lenght="1h 33min">2008</year><type>Sensacyjny</type><production premiere="27 lutego">Francja,USA,Wielka Brytania</production><direction screenplay="Luc BessonRobert Mark Kamen">Pierre Morel</direction><assigment>bardzo dobry</assigment> </Taken><Expendables><year lenght="1h 43min">2010</year><type>Akcja</type><production premiere="3 sierpnia">USA</production><direction screenplay="Dave Callaham,Sylvester Stallone">Sylvester Stallone</direction><assigment>dobry</assigment> </Expendables></films></mycollecion> Here's my XSD document:<?xml version="1.0" encoding="utf-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <!-- Jako przedmiot mojej kolekcji wybrałem filmy. Wybrałem akurat te ponieważ należą do moich ulubionych.Imię i nazwisko: Tomasz KempaPełny nr grupy dziekańskiej: KrDZIs1012 --> <xsd:element name="mycollection" type="string"><xsd:complexType> <xsd:element name="owner" type="string"><xsd:complexType><xsd:sequence> <xsd:element name="name" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="6"/><xsd:maxLength valuv="11"/></xsd:restriction><xsd:element name="surname" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction><xsd:element name="age" type="xsd:integer"minInclusive="17" maxInclusive="22"/><xsd:attribute plec="######" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:enumeration value="mężczyzna"/><xsd:enumeration value="kobieta"/></xsd:restriction><xsd:element name="town" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction><xsd:attribute name="originCountry" type="xsd:string"/><xsd:element name="studyField" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="40"/></xsd:restriction><xsd:attribute name="semester" type="xsd:string"/><xsd:element name="deansgrupe" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="20"/></xsd:restriction><xsd:element name="email" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="40"/></xsd:restriction> </xsd:sequence></xsd:complexType></xsd:element> <xsd:simpleType name="TypCopyright"><xsd:restriction base="xsd:string"><xsd:minLength value="2"/> <xsd:maxLength value="80"/></xsd:restriction> </xsd:simpleType> <xsd:element name="filmy"><xsd:complexType><xsd:sequence> <xsd:element name="Transporter" type="string"><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction><xsd:element name="year" type="xsd:integer" minInclusive="1990" maxInclusive="2012"/><xsd:attribute name="lenght" type="xsd:string"/><xsd:element name="type" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:element name="production" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:attribute name="premiere" type="xsd:string"/><xsd:elemment name="direction" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="2"/><xsd:maxLength valuv="40"/></xsd:restriction> <xsd:attribute name="screenplay" type="xsd:string"/><xsd:element name="assigment" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction></xsd:element><xsd:element name="ForrestGump" type="string"><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction><xsd:element name="year" type="xsd:integer" minInclusive="1990" maxInclusive="2012"/><xsd:attribute name="lenght" type="xsd:string"/><xsd:element name="type" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:element name="production" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:attribute name="premiere" type="xsd:string"/><xsd:elemment name="direction" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="2"/><xsd:maxLength valuv="40"/></xsd:restriction> <xsd:attribute name="screenplay" type="xsd:string"/><xsd:element name="assigment" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction></xsd:element><xsd:element name="Matrix" type="string"><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction><xsd:element name="year" type="xsd:integer" minInclusive="1990" maxInclusive="2012"/><xsd:attribute name="lenght" type="xsd:string"/><xsd:element name="type" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:element name="production" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:attribute name="premiere" type="xsd:string"/><xsd:elemment name="direction" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="2"/><xsd:maxLength valuv="40"/></xsd:restriction> <xsd:attribute name="screenplay" type="xsd:string"/><xsd:element name="assigment" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction></xsd:element><xsd:element name="Avatar" type="string"><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction><xsd:element name="year" type="xsd:integer" minInclusive="1990" maxInclusive="2012"/><xsd:attribute name="lenght" type="xsd:string"/><xsd:element name="type" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:element name="production" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:attribute name="premiere" type="xsd:string"/><xsd:elemment name="direction" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="2"/><xsd:maxLength valuv="40"/></xsd:restriction> <xsd:attribute name="screenplay" type="xsd:string"/><xsd:element name="assigment" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction></xsd:element><xsd:element name="Gladiator" type="string"><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction><xsd:element name="year" type="xsd:integer" minInclusive="1990" maxInclusive="2012"/><xsd:attribute name="lenght" type="xsd:string"/><xsd:element name="type" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:element name="production" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:attribute name="premiere" type="xsd:string"/><xsd:elemment name="direction" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="2"/><xsd:maxLength valuv="40"/></xsd:restriction> <xsd:attribute name="screenplay" type="xsd:string"/><xsd:element name="assigment" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction></xsd:element><xsd:element name="Titanic" type="string"><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction><xsd:element name="year" type="xsd:integer" maxOccurs="1990" minOccurs="2012"/><xsd:attribute name="lenght" type="xsd:string"/><xsd:element name="type" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:element name="production" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:attribute name="premiere" type="xsd:string"/><xsd:elemment name="direction" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="2"/><xsd:maxLength valuv="40"/></xsd:restriction> <xsd:attribute name="screenplay" type="xsd:string"/><xsd:element name="assigment" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction></xsd:element><xsd:element name="Inception" type="string"><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction><xsd:element name="year" type="xsd:integer" minInclusive="1990" maxInclusive="2012"/><xsd:attribute name="lenght" type="xsd:string"/><xsd:element name="type" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:element name="production" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:attribute name="premiere" type="xsd:string"/><xsd:elemment name="direction" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="2"/><xsd:maxLength valuv="40"/></xsd:restriction> <xsd:attribute name="screenplay" type="xsd:string"/><xsd:element name="assigment" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction></xsd:element><xsd:element name="FastFive" type="string"><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction><xsd:element name="year" type="xsd:integer" minInclusive="1990" maxInclusive="2012"/><xsd:attribute name="lenght" type="xsd:string"/><xsd:element name="type" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:element name="production" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:attribute name="premiere" type="xsd:string"/><xsd:elemment name="direction" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="2"/><xsd:maxLength valuv="40"/></xsd:restriction> <xsd:attribute name="screenplay" type="xsd:string"/><xsd:element name="assigment" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction></xsd:element><xsd:element name="Taken" type="string"><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction><xsd:element name="year" type="xsd:integer" minInclusive="1990" maxInclusive="2012"/><xsd:attribute name="lenght" type="xsd:string"/><xsd:element name="type" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:element name="production" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:attribute name="premiere" type="xsd:string"/><xsd:elemment name="direction" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="2"/><xsd:maxLength valuv="40"/></xsd:restriction> <xsd:attribute name="screenplay" type="xsd:string"/><xsd:element name="assigment" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction></xsd:element><xsd:element name="Expendables" type="string"><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction><xsd:element name="year" type="xsd:integer" minInclusive="1990" maxInclusive="2012"/><xsd:attribute name="lenght" type="xsd:string"/><xsd:element name="type" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:element name="production" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="3"/><xsd:maxLength valuv="25"/></xsd:restriction><xsd:attribute name="premiere" type="xsd:string"/><xsd:elemment name="direction" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="2"/><xsd:maxLength valuv="40"/></xsd:restriction> <xsd:attribute name="screenplay" type="xsd:string"/><xsd:element name="assigment" type="xsd:string"/><xsd:restriction base="xsd:string"><xsd:minLength value="5"/><xsd:maxLength valuv="11"/></xsd:restriction></xsd:element> </xsd:sequence></xsd:complexType> </xsd:element> </xsd:complexType></xsd:element> </xsd:schema> When I use this validator http://www.corefiling.com/opensource/schemaValidate.htmlthis problems appear... ;[ 1) LOC (12, 43) - s4s-elt-invalid-content.1: The content of '#AnonType_mycollection' is invalid. Element 'element' is invalid, misplaced, or occurs too often.2) LOC (9, 48) - src-element.3: Element 'mycollection' has both a 'type' attribute and a 'anonymous type' child. Only one of these is allowed for an element.3) LOC (5, 14) - cvc-elt.1.a: Cannot find the declaration of element 'mycollecion'. I hope You will be able to help me! I really appreciate any help! BIG THANKS for You! Wishes Guys! ;))))

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...