[xml] [BUG?] Global attribute declaration in schema is not used at root node



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear libxml hackers,

I am by no stretch enlightened in XML schemas, but I'm seeing a
behavior that very much looks like a bug in libxml2's w3c-schema
validator. I'm using version 2.6.22 on Debian sarge.

I believe the two XML files below should both validate, but only
ok.xml actually does. Rationale: "free" attribute declarations (here
the id attribute) are available to all elements, or so I thought.

== ok.xml ==

<foo xmlns="http://example.com/xsd/ns";><bar id="abc"/></foo>

== notok.xml ==

<foo xmlns="http://example.com/xsd/ns"; id="abc"><bar /></foo>

== schema.xml ==

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
            targetNamespace="http://example.com/xsd/ns";
            elementFormDefault="qualified"
            attributeFormDefault="qualified">
  <!-- "floating" attribute -->
  <xsd:attribute name="id" type="xsd:ID"/>
  <!-- Bogus elements -->
  <xsd:element name="foo">
    <xsd:complexType>
       <xsd:sequence>
      <xsd:element minOccurs="0" maxOccurs="1" name="bar" />
       </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

- --
Dominique QUATRAVAUX                           Ingénieur senior
01 44 42 00 08                                 IDEALX

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDjchTMJAKAU3mjcsRAprbAJ9tbFUr58Fo1VdekACbGoAGzcv++QCgtoaB
jLOI1CX6YkZbvn4ufxedHE0=
=/DTc
-----END PGP SIGNATURE-----





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