Hello Inga, something seems to be wrong with the namespaces for "nachname" and "vorname". Maybe this helps: Assembling a Schema from a Schema with no targetNamespace: - A Schema can <include> another schema that has no targetNamespace. The included components take on the namespace of the schema that is doing the <include> (this is called the Chameleon Effect) (see: http://www.xfront.com/xml-schema.html).
So your included schema shoul look like this: <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" elementFromDefault="qualified"> <xsd:complexType name="adresse"> <xsd:sequence> <xsd:element ref="nachname"/> <xsd:element ref="vorname"/> </xsd:sequence> </xsd:complexType> <xsd:element name="nachname" type="xsd:string"/> <xsd:element name="vorname" type="xsd:string"/> </xsd:schema> -- Regards, Birgit mailto:[EMAIL PROTECTED] Monday, April 09, 2001, 3:40:39 PM, you wrote: > Hallo, > i don't know what's wrong with my XML files. If I validate them with XMLSpy > 3.5. They are valid, but if I validate them with the XERCES Parser 1.3.1 I > get the following Errors > D:\USERS\schuetz\XML>java sax.SAXCount -s -v personal2.xml > [Error] personal2.xml:7:16: The content of element type "pers:name" must > match " > (nachname,vorname)". > [Error] personal2.xml:15:16: The content of element type "pers:name" must > match > "(nachname,vorname)". > [Error] personal2.xml:22:16: The content of element type "pers:name" must > match > "(nachname,vorname)". > [Error] personal2.xml:29:16: The content of element type "pers:name" must > match > "(nachname,vorname)". > [Error] personal2.xml:36:16: The content of element type "pers:name" must > match > "(nachname,vorname)". > personal2.xml: 3515 ms (27 elems, 14 attrs, 109 spaces, 156 chars) > XML-File: > <?xml version="1.0" encoding="UTF-8"?> > <pers:personal xmlns:pers="http://www.test.de" > xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" > xsi:schemaLocation="http://www.test.de personal2.xsd"> > <pers:person id="chef"> > <pers:name> > <pers:nachname>Meier</pers:nachname> > <pers:vorname>Erwin</pers:vorname> > </pers:name> > <pers:email>[EMAIL PROTECTED]</pers:email> > <pers:url > href="http://www.foo.com">http://www.foo.com</pers:url> > </pers:person> > <pers:person id="arbeiter.eins"> > <pers:name> > <pers:nachname>Sommer</pers:nachname> > <pers:vorname>Torsten</pers:vorname> > </pers:name> > <pers:email>[EMAIL PROTECTED]</pers:email> > </pers:person> > <pers:person id="arbeiter.zwei"> > <pers:name> > <pers:nachname>Clemens</pers:nachname> > <pers:vorname>Jens</pers:vorname> > </pers:name> > <pers:email>[EMAIL PROTECTED]</pers:email> > </pers:person> > <pers:person id="arbeiter.drei"> > <pers:name> > <pers:nachname>Hoch</pers:nachname> > <pers:vorname>Matthias</pers:vorname> > </pers:name> > <pers:email>[EMAIL PROTECTED]</pers:email> > </pers:person> > <pers:person id="arbeiter.vier"> > <pers:name> > <pers:nachname>Weidenhausen</pers:nachname> > <pers:vorname>Robert</pers:vorname> > </pers:name> > <pers:email>[EMAIL PROTECTED]</pers:email> > </pers:person> > </pers:personal> > My first Schema: > ?xml version="1.0" encoding="UTF-8"?> > <!-- edited with XML Spy v3.5 NT (http://www.xmlspy.com) by schuetz (BA-Mannheim) -->> > <schema targetNamespace="http://www.test.de" xmlns:adr="http://www.test.de" > xmlns="http://www.w3.org/2000/10/XMLSchema" elementFormDefault="qualified"> > <include schemaLocation="adresse.xsd"/> > <element name="personal"> > <complexType> > <sequence> > <element ref="adr:person" > maxOccurs="unbounded"/> > </sequence> > </complexType> > </element> > <element name="person"> > <complexType> > <sequence> > <element name="name" type="adr:adresse"/> > <element ref="adr:email" minOccurs="0" > maxOccurs="unbounded"/> > <element name="url" type="adr:url" > minOccurs="0" maxOccurs="unbounded"/> > </sequence> > <attribute name="id" type="ID" use="required"/> > <attribute name="anmerkung" type="string"/> > <attribute name="vertrag" use="default" value="false"> > <simpleType> > <restriction base="string"> > <enumeration value="true"/> > <enumeration value="false"/> > </restriction> > </simpleType> > </attribute> > </complexType> > </element> > <element name="email" type="string"/> > <complexType name="url"> > <simpleContent> > <extension base="string"> > <attribute name="href" type="string"/> > </extension> > </simpleContent> > </complexType> > <notation name="gif" public="-//APP/Photoshop/4.0" > system="photoshop.exe"/> > </schema> > The included schema: > <?xml version="1.0" encoding="UTF-8"?> > <xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" > targetNamespace="http://www.test.de" xmlns="http://www.test.de"> > <xsd:complexType name="adresse"> > <xsd:sequence> > <xsd:element ref="nachname"/> > <xsd:element ref="vorname"/> > </xsd:sequence> > </xsd:complexType> > <xsd:element name="nachname" type="xsd:string"/> > <xsd:element name="vorname" type="xsd:string"/> > </xsd:schema> > May be someone can help me and knows what is wrong? > Thanks Inga > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
