help - attributes namespace - is this a bug in PyXML

Ajay abra9823 at mail.usyd.edu.au
Mon Aug 16 11:46:13 EDT 2004


hi!

for the XML
<appel:RULESET xmlns:appel="http://www.w3.org/2001/02/appelv1"
xmlns:p3p="http://www.w3.org/2000/12/p3pv1">
<appel:RULE prompt="no">
<p3p:POLICY>
  <p3p:ACCESS appel:connective="non-and">
    <p3p:all/>
  </p3p:ACCESS>
</p3p:POLICY>
</appel:RULE>

if i getupto the "ACCESS" element and print its attribute name and value
using
if attribs != None and len(attribs) > 0:
        index = 0
	while index < attribs.length:
		print "attribute ", index, ": ",     attribs.item(index).nodeName, " has
value: ", attribs.item(index).nodeValue
		index += 1

it prints ACCESS having the attribute "appel:connective" with the value
"non-and"
the statement attribs.getNamedItem("appel:connective") however returns
None.
now i think its substituting the namespace for appel but then how would you
access the attribute, just 'connective' doesn't work, 'appel:connective'
doesn't either and http://www.w3.org/2001/02/appelv1:connective doesn't
work either.

thanks

cheers










----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the Python-list mailing list