tid-kijyun / Kanna

Kanna(鉋) is an XML/HTML parser for Swift.
MIT License
2.42k stars 221 forks source link

bugfix: supporting namespace for querying the same attribute name with different namespace #264

Closed codelynx closed 9 months ago

codelynx commented 9 months ago

bugfix: when a node has two attributes "id" and "r:id", node["r:id"] will not find its attribute value, by checking ns (namespace) to be able to find right attribute obscured by the same attribute name with different namespace.

Following example demonstrates the attribute "r:id" will be found by node["r:id"]. Because, subscript(attributeName: String) only checks tagName, then "r:id" will be obscured by "id".

<p:sldIdLst>
    <p:sldId id="256" r:id="rId2" />
    <p:sldId id="257" r:id="rId3" />
</p:sldIdLst>