Note that there are some explanatory texts on larger screens.

plurals
  1. POAttributeError: 'NoneType' object has no attribute 'nodeValue'
    primarykey
    data
    text
    <p>I am using ksoap to communicate between an android app and the python server containing the following files posted. I am trying to retrieve all the values in the XML file posted. But i keep getting, <code>AttributeError: 'NoneType' object has no attribute 'nodeValue'</code>. Can anyone tell me what's wrong with the code as I tried to debug the error but still failed to do so.</p> <p>Portion of the XML file (only MacFilterList and Map node can be empty):</p> <pre><code>&lt;ProfileList&gt; &lt;Profile&gt; &lt;ProfileName&gt;Lab1&lt;/ProfileName&gt; &lt;Owner&gt;admin&lt;/Owner&gt; &lt;Map&gt;Lab&lt;/Map&gt; &lt;Visible&gt;True&lt;/Visible&gt; &lt;MacFilterList&gt; &lt;string&gt;00:14:BF:9F:5D:3A&lt;/string&gt; &lt;string&gt;00:14:BF:9F:5D:52&lt;/string&gt; &lt;string&gt;00:14:BF:9F:5D:37&lt;/string&gt; &lt;string&gt;00:14:BF:9F:5D:43&lt;/string&gt; &lt;/MacFilterList&gt; &lt;/Profile&gt; . . &lt;/ProfileList&gt; </code></pre> <p>soapAPI.py (<code>PROFILE_XML</code> refers to the filename of the xml file.):</p> <pre><code>def __init__(self): self.profileFile = Config.PROFILE_XML self.profile = XML_ProfileDataStore() self.profile.LoadXMLFile(self.profileFile) . . def GetAllProfileData(self): self.profileFile = Config.PROFILE_XML self.profile.LoadXMLFile(self.profileFile) result = self.profile.GetAllProfileData() return result </code></pre> <p>profileData.py (where the class, <code>XML_ProfileDataStore</code> is):</p> <pre><code>def GetAllProfileData(self): #Get a node list containing nodes with name Location ProfileList = self.XMLdoc.getElementsByTagName('Profile') NumArgCheck = 0 profiles="" #For each location node in list for profileNode in ProfileList: #For each child nodes in Location node, compare the XY coordinates for ChildNode in profileNode.childNodes: #If child node has profile name profile_name if (cmp(ChildNode.nodeName, 'ProfileName') == 0): NumArgCheck += 1 profiles = profiles + ChildNode.firstChild.data + "," ChildNode = ChildNode.nextSibling profiles = profiles + ChildNode.firstChild.nodeValue + "," ChildNode = ChildNode.nextSibling profiles = profiles + ChildNode.firstChild.nodeValue + "," ChildNode = ChildNode.nextSibling profiles = profiles + ChildNode.firstChild.nodeValue ChildNode = ChildNode.nextSibling for child in ChildNode.childNodes: profiles = profiles + "," + child.firstChild.nodeValue profiles = profiles+";" return profiles </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload