[XML-SIG] [SOLVED] soapy hacking -- getAttributeNS
Mark Bucciarelli
mark@easymailings.com
Thu, 27 Feb 2003 02:58:22 +0000
On Wednesday 26 February 2003 10:48 pm, Mark Bucciarelli wrote:
> Stupid question ... what's the proper way to retrieve the value of the name
> attribute using pnode.getAttributeNS()?
Nope. To get at an attribute without a namespace prefix, you must use
getAttribute, not getAttributeNS.
Another interesting thing I found is if an attribute does have a prefix, then
the xmlns declaration must be in a parent tag--it cannot be in the same tag
as the attribute.
So, there is no way to get the value of the name attribute from the following
xml:
s = "<root><test xmlns:mb='http://123' mb:name='abc' /></root>"
Maybe this isn't legal xml.
Mark