This is what I get when running: domprint -e -v=always -n -s -f data.XML Error at file "C:\xerces-c_2_6_0-windows_nt-msvc_60\bin/data.XML", line 8, column 27 Message: Attribute 'time' is not declared for element 'Cube' Error at file "C:\xerces-c_2_6_0-windows_nt-msvc_60\bin/data.XML", line 9, column 40 Message: Attribute 'currency' is not declared for element 'Cube' Error at file "C:\xerces-c_2_6_0-windows_nt-msvc_60\bin/data.XML", line 9, column 40 Message: Attribute 'rate' is not declared for element 'Cube' Error at file "C:\xerces-c_2_6_0-windows_nt-msvc_60\bin/data.XML", line 10, column 40 Message: Attribute 'currency' is not declared for element 'Cube' Error at file "C:\xerces-c_2_6_0-windows_nt-msvc_60\bin/data.XML", line 10, column 40 Message: Attribute 'rate' is not declared for element 'Cube' Error at file "C:\xerces-c_2_6_0-windows_nt-msvc_60\bin/data.XML", line 11, column 40 Message: Attribute 'currency' is not declared for element 'Cube' Error at file "C:\xerces-c_2_6_0-windows_nt-msvc_60\bin/data.XML", line 11, column 40 Message: Attribute 'rate' is not declared for element 'Cube' Error at file "C:\xerces-c_2_6_0-windows_nt-msvc_60\bin/data.XML", line 12, column 40 Message: Attribute 'currency' is not declared for element 'Cube' Error at file "C:\xerces-c_2_6_0-windows_nt-msvc_60\bin/data.XML", line 12, column 40 Message: Attribute 'rate' is not declared for element 'Cube' Error at file "C:\xerces-c_2_6_0-windows_nt-msvc_60\bin/data.XML", line 13, column 10 Message: Element 'Cube' is not valid for content model: '(Cube,)' Error at file "C:\xerces-c_2_6_0-windows_nt-msvc_60\bin/data.XML", line 14, column 9 Message: Element 'Cube' is not valid for content model: '(Cube,)'
It looks like the validator selects the wrong Cube definition. That suspicion was strengthened after a look at the output from PSVIWriter. It seems like the system uses the same typedefinition for Cube disregarding of which context the Cube element occurrs in. I did a quick edit of the ecb.xsd to use this format instead: <RootCube> <SubCube> <Cube .... > <Cube .... > </SubCube> </RootCube> After I changed the elementFormDefault to 'qualified' the xml file was valid and domprint accepted it. So I guess there is a bug that selects the wrong schema definition if the file uses different definitions for elements with the same name. / Erik > -----Original Message----- > From: Erik Rydgren [mailto:[EMAIL PROTECTED] > Sent: den 4 november 2004 16:58 > To: [EMAIL PROTECTED] > Subject: More include Schema in a Schema problems > > I'm having problems getting some xml through the xerces validator. The > file is valid through Altova XmlSpy but not in Xerces for some reason. > The file is downloaded from the European central bank and looks like > this: > > <?xml version="1.0" encoding="UTF-8"?> > <gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" > xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.gesmes.org/xml/2002-08-01 gesmes.xsd"> > <gesmes:subject>Reference rates</gesmes:subject> > <gesmes:Sender> > <gesmes:name>European Central Bank</gesmes:name> > </gesmes:Sender> > <Cube> > <Cube time='2004-10-27'> > <Cube currency='USD' rate='1.2792'/> > <Cube currency='JPY' rate='136.37'/> > <Cube currency='DKK' rate='7.4348'/> > </Cube> > </Cube> > </gesmes:Envelope> > > There are also two schemas involved. First gesmes.xsd: > > <?xml version="1.0" encoding="UTF-8"?> > <xs:schema targetNamespace="http://www.gesmes.org/xml/2002-08-01" > xmlns:ecb="http://www.ecb.int/vocabulary/2002-08-01/eurofxref" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" > elementFormDefault="qualified"> > <xs:import > namespace="http://www.ecb.int/vocabulary/2002-08-01/eurofxref" > schemaLocation="ecb.xsd"/> > <xs:complexType name="subjectType"/> > <xs:complexType name="SenderType"> > <xs:sequence> > <xs:element name="name" type="xs:string"/> > </xs:sequence> > </xs:complexType> > <xs:complexType name="rootType"> > <xs:sequence> > <xs:element name="subject" type="xs:string"/> > <xs:element name="Sender" type="gesmes:SenderType"/> > <xs:element ref="ecb:Cube"/> > </xs:sequence> > </xs:complexType> > <xs:element name="Envelope" type="gesmes:rootType"/> > </xs:schema> > > The second schema is ecb.xsd: > > <?xml version="1.0" encoding="UTF-8"?> > <xs:schema > targetNamespace="http://www.ecb.int/vocabulary/2002-08-01/eurofxref" > xmlns:ecb="http://www.ecb.int/vocabulary/2002-08-01/eurofxref" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > elementFormDefault="unqualified"> > <xs:complexType name="CubeType3"> > <xs:attribute name="currency" type="xs:string"/> > <xs:attribute name="rate" type="xs:decimal"/> > </xs:complexType> > <xs:complexType name="CubeType2"> > <xs:sequence> > <xs:element name="Cube" type="ecb:CubeType3" minOccurs="0" > maxOccurs="unbounded"/> > </xs:sequence> > <xs:attribute name="time" type="xs:date"/> > </xs:complexType> > <xs:complexType name="CubeType"> > <xs:sequence> > <xs:element name="Cube" type="ecb:CubeType2" minOccurs="0" > maxOccurs="unbounded"/> > </xs:sequence> > </xs:complexType> > <xs:element name="Cube" type="ecb:CubeType"/> > </xs:schema> > > As I said XmlSpy regards the data as valid but Xerces tells me that Cube > is not valid content to envelope. I can't figure out what the problem > is. Any help would be greatly appriciated. > > Best regards > Erik Rydgren > > > > --------------------------------------------------------------------- > 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]