Hello. Is there a way to access XML nodes with something like this:
domDoc.elementsByTagName("methodResponse/params/param/value/struct/member")
domDoc.elementsByTagName("methodResponse/params/param/value/struct/member")
To copy to clipboard, switch view to plain text mode
instead of
QDomElement elem
= domDoc.
firstChildElement("methodResponse").
firstChildElement("params").
firstChildElement("param").
firstChildElement("value").
firstChildElement("struct").
firstChildElement("member")
QDomElement elem = domDoc.firstChildElement("methodResponse").firstChildElement("params").firstChildElement("param").firstChildElement("value").firstChildElement("struct").firstChildElement("member")
To copy to clipboard, switch view to plain text mode
Here follows the sample XML document. I need to get access to all 'member' nodes.
<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>token</name>
<value>
<string>532236bdf362493h5</string>
</value>
</member>
<member>
<name>status</name>
<value>
<string>200 OK</string>
</value>
</member>
<member>
<name>seconds</name>
<value>
<double>0.008</double>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>token</name>
<value>
<string>532236bdf362493h5</string>
</value>
</member>
<member>
<name>status</name>
<value>
<string>200 OK</string>
</value>
</member>
<member>
<name>seconds</name>
<value>
<double>0.008</double>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
To copy to clipboard, switch view to plain text mode
Bookmarks