Hey,
If you prefix cube with an appropriate binding, what happens? I am wondering about what the spec would say about 1 schema the has
elementFormDefault="qualified"
including 1 that does
elementFormDefault="unqualified"
Also, the first schema does state that elements should be qualified. Try it and see and I will take a look in the schema spec to see what should happen.
Cheers,
Gareth
Erik Rydgren wrote:
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]
--
Gareth Reakes, Managing Director Parthenon Computing
+44-1865-811184 http://www.parthcomp.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]