[xml] "w3c xml schema: test schema po1_0.xsd might be invalid"



Hi,

There is a test named "po1_0.xsd" ("po1_0.xml") which validates, but 
probaply should not:

The <schema> information element looks like this:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
             xmlns:po="http://www.example.com/PO1";
            targetNamespace="http://www.example.com/PO1";
            elementFormDefault="unqualified"
            attributeFormDefault="unqualified">

Note that it has a target namespace and no default namespace.

Further there is a top level element declaration:

<xsd:element name="comment" type="xsd:string"/>

The spec states:
"If the <element> element information item has <schema> as its parent, 
the corresponding schema component is as follows:
[..]
target namespace: The ·actual value· of the targetNamespace [attribute] 
of the parent <schema> element information item, or ·absent· if there is 
none."

This means that the declaration has a target namespace of 
"http://www.example.com/PO1";.

This declaration is referenced:

<xsd:element ref="comment" minOccurs="0"/>

Now, ref ("comment") is a QName that has no prefix, since no default 
namespace is given it should match to an element declaration with no 
target namespace.

Is this xsd schema invalid? Any comments?


Regards,

Kasimier




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]