[XML-SIG] Is this a bug?
Martin v. Loewis
martin@v.loewis.de
Sat, 27 Oct 2001 10:53:40 +0200
> I don't really understand the part that says "one can set two attributes (or
> more) that have different nodeNames but the same prefix and namespaceURI. In
> this case getAttributeNodeNS will return either attribute,"
>
> It doesn't seem to make sense to me; a different nodeName like 'foo' means
> getAttributeNodeNS asking for 'bar' in some namespace will never return
> 'foo', right?
This probably deals with the case
<root xmlns:foo="http://www.python.org/ns">
<node xmlns:bar="http://www.python.org/ns">
<elem foo:attr="1"/>
</node>
</root>
Given elem, you can now do
a1 = elem.documentNode.createAttribute("bar:attr")
a1.nodeValue = "2"
elem.setAttributeNode(a1)
Now, you do
elem.getAttributeNS("http://www.python.org/ns", "attr")
This could return either "1" or "2", depending on the implementation.
> Anyway, it does seem to indicate that getAttribute() should return
> *something*; it's just not defined which one if there are multiple
> attributes with the same nodeName but in different namespaces.
I agree. So to me, it seems that there is a number of bugs in 4DOM in
that respsect.
> I'm only replying because I've been examining this spec too much the
> last week, and I knew I just read something about this. :)
That is much appreciated. Having an independent analysis really helps.
Regards,
Martin