help - attributes namespace - is this a bug in PyXML

A

Ajay

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top