- From: Henry S. Thompson <ht@inf.ed.ac.uk>
- Date: Fri, 21 Oct 2011 12:07:23 +0100
- To: Ivan Herman <ivan@w3.org>
- Cc: Toby Inkster <tai@g5n.co.uk>, public-rdfa-wg@w3.org
Ivan Herman writes:
> Except if the has AttributeNS function is not available...
I'm confused -- miniDom has this function, in stock Python 2.6 and
2.7, which is what I thought you said you were using?
Python 2.6.5 (r265:79063, Jun 12 2010, 17:07:01)
[GCC 4.3.4 20090804 (release) 1] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from xml.dom.minidom import parseString
>>> d=parseString("<r xmlns:x='http://www.w3.org/1999/xhtml'
x:about='#foo'/>")
>>> d.firstChild.getAttributeNode('x:about').namespaceURI
u'http://www.w3.org/1999/xhtml'
>>> d.firstChild.hasAttributeNS('http://www.w3.org/1999/xhtml','about')
True
ht
--
Henry S. Thompson, School of Informatics, University of Edinburgh
10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 651-1426, e-mail: ht@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail from me _always_ has a .sig like this -- mail without it is forged spam]
Received on Friday, 21 October 2011 11:08:08 UTC