Re: [reSIProcate] XML parser
I'm trying to walk through the xml that I have and I couldn't get the value of a certain tag. This is the xml:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" entity="
sip:mateusruivo@xxxxxxxxx">
<dm:person id="p6311">
<rpid:activities/>
</dm:person>
<tuple id="t5763">
<status>
<basic>open</basic>
</status>
<contact>
sip:mateusruivo@xxxxxxxxx</contact>
<note>Online</note>
</tuple>
</presence>
When I get to <contact> I try to do a getValue() [1] but I'm getting an empty string. I also didn't understand the implementation of this function: why it is getting the value only of leaf nodes? what if the node I want to get the value is not a leaf?
I also tried to use pidf parse [2] like this:
ParseBuffer pb(notifyData.data(), notifyData.size());
NameAddr res;
res.parse(pb);
But I'm getting an error:
DEBUG | 20160710-224736.679 | telepathy-resiprocate | RESIP | 140593923626752 | ParseBuffer.cxx:971 | ParseBuffer.cxx:735, Parse failed Expected a digit in context:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" entity="
sip:mateusruivo@xxxxxxxxx">[CRLF]
^[CRLF]
<dm:person id="p6311">
<rpid:activities/>
</dm:person>
<tuple id="t5763">
<status>
<basic>open</basic>
</status>
<contact>
sip:mateusruivo@xxxxxxxxx</contact>
<note>Online</note>
</tuple>
</presence>
Any help would be greatly appreciated.