Re: [xml] Namespaces and Uniqueness of Attributes



Karl Eichwalder said:
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.
_______________________________________________

I believe this was caused by some changes introduced at the end of July in the
module SAX2.c.  I made a small modification to that logic which should fix the
problem you reported.  The changed code is in CVS - please try it and report
any further trouble.

Thanks for the report.

Bill




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