[xml] Namespaces and Uniqueness of Attributes



Up to libxml2 2.6.11 xmllint used to parse this code

<element name="foo" xmlns:rng="http://example.org/ns/1";
xmlns="http://example.org/ns/1";>
  <empty/>
</element>

as

<?xml version="1.0"?>
<element xmlns:rng="http://example.org/ns/1"; xmlns="http://example.org/ns/1";
name="foo">
  <empty/>
</element>

Now it adds the prefix of the default(?) namespace:

<?xml version="1.0"?>
<element xmlns:rng="http://example.org/ns/1"; xmlns="http://example.org/ns/1";
name="foo">
  <rng:empty/>
</element>

If the attributes are unique, it does not add the prefix:

<?xml version="1.0"?>
<element xmlns:rng="http://example.org/ns/1"; xmlns="http://example.org/ns/1X";
name="foo">
  <empty/>
</element>

<?xml version="1.0"?>
<element xmlns:rng="http://example.org/ns/1"; xmlns="http://example.org/ns/1X";
name="foo">
  <empty/>
</element>

This change affects the trang testsuite.



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