Hi,
I am working in a socket application where I am sending the data to the server in xml form and receiving reesponse for it in an xml format. The problem is that when I am trying to parse the message I am getting the error that it cannot parse the xml.
I am using the API
QDomDocument setContent(byteArray);
in the byteArray there is a message in xml format from the server. When I debugged the API I found that the error was because of the comment format in the server response.
The server response was
Qt Code:
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--- TCP probe server response v0.121 --->
  3. <probeResponse version="1.0" xmlns="https://www.xxxx.com/schemas/probe/v1_0">
  4. <params>
  5. <period>45</period>
  6. <next>90</next>
  7. <dec>0.71</dec>
  8. <valid>604800</valid>
  9. <count>10</count>
  10. </params>
  11. <detect>
  12. <xaddress>0x0a24654e</xaddress>
  13. <xport>0x068c</xport>
  14. </detect>
  15. <timestamp>44675436</timestamp>
  16. <nonce>JwMFecnLFUz/REJ8HuQE45943</nonce>
  17. <signature method="HMAC-SHA1">ZajDI9xJLFfP3B8UFSVCmk9oyLY=</signature>
  18. </probeResponse>
To copy to clipboard, switch view to plain text mode 
Now the comment understood by QDomComment is in the form of
<!-- XXXXX -->
Since the server response is having the comment as <!--- XXXX --->
an extra "-" so it is giving error there. When I try to write the response in file and manually remove the "-" from comment and then try to use setContent() it works like charm.
Please help me is there any way I can define the rule to accept such comment as valid comment because the server implementation cant be changed I have to have some kind of work around to make this accept as valid xml message.

Regards,
Yogesh