[xml] [Bug][Patch] xmllint was not parsing the --c14n11 flag



Note: The bug description below was extracted from my ticket in my fork of libxml2 @ GitHub and is formatted using markdown.

---- Start of Bug description ----
When running `$ xmllint --c14n11 [other options] [xmlfile]` it doesn't sort the attributes as per the [Canonical XML Version 1.1](http://www.w3.org/TR/xml-c14n11/) from w3c.

Specifically I note that the following specifications are not verified:
> * The XML declaration and document type declaration are removed
* Lexicographic order is imposed on the namespace declarations and attributes of each element

These specifications, already existent in the [previous recomendation](http://www.w3.org/TR/xml-c14n), hold with the call of `$ xmllint --c14n [other options] [xmlfile]`.

#### I/O
*Note the order of the attributes and the XML declaration and document type*
##### Input
```xml
<?xml version="1.0"?>
<root>
<!-- I am a comment -->

<h:table xmlns:h="http://www.w3.org/TR/html4/">
  <h:tr>
    <h:td c="" a=""
z="" >Apples</h:td>
    <h:td>Bananas</h:td>
  </h:tr>
</h:table>
</root>
```
##### Expected Output
```xml
<root>
<!-- I am a comment -->

<h:table xmlns:h="http://www.w3.org/TR/html4/">
  <h:tr>
    <h:td a="" c="" z="">Apples</h:td>
    <h:td>Bananas</h:td>
  </h:tr>
</h:table>
</root>
```
##### Actual Output
```xml
<?xml version="1.0"?>
<root>
<!-- I am a comment -->

<h:table xmlns:h="http://www.w3.org/TR/html4/">
  <h:tr>
    <h:td c="" a="" z="">Apples</h:td>
    <h:td>Bananas</h:td>
  </h:tr>
</h:table>
</root>
```
---- End of Bug description ----

In attachment there's the patch that fixes this behaviour.

Best regards,

Sérgio Batista

Attachment: 0e97c3ee2674db2fe466ed0aa191b690c9f5af70.patch
Description: Text Data



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