[XML-SIG] Conditions for using XLink
Dinu Gherman
gherman@darwin.in-berlin.de
Thu, 04 Apr 2002 20:37:10 +0200 (CEST)
Uche Ogbuji <uche.ogbuji@fourthought.com>:
> > I'm trying to read XML files with FromXmlFile() that contain XLink
> > attributes like this: <foo xlink:href="#bar"/>. This results in the
> > following traceback below. I'm using the following environment:
>
> This is almost certainly a bug in your XML. Can you post the whole
> thing? Or perhaps a smaller subset of it that demonstrates the prob-
> lem, but is complete in itself.
I found that adding the following xmlsn-attribute to the root
element:
<document xmlns:xlink="http://www.w3.org/1999/xlink">
things work much better and there is no more traceback.
But then I need to access the attribute value for, say,
<foo xlink:href="#bar"/>
And after looking into the test suite I'm able to get it, but *only*
in this way:
xlink_href = node.getAttributeNS('http://www.w3.org/1999/xlink', 'href')
but not as I had liked, e.g. like this:
xlink_href = node.getAttributeNS('xlink', 'href')
So, I wonder if I really need to give the full URI, because that would
mean I need to store this at the beginning for the root element. I'm
feeling like I must be doing or getting something wrong about it...
Thanks for shedding some light into this, if you please!
Regards,
Dinu