Ehhhh, I thought there was some other way to do it
Anyway, thank you for answer!
Czesc![]()
Ehhhh, I thought there was some other way to do it
Anyway, thank you for answer!
Czesc![]()
Last edited by Kill3rReaper; 25th July 2009 at 22:24.
Ehhh... I just was writing new class for XML packets, when I try to write something XML to <body> </body> section... Code between these tags is interpretting by my algorism... When I was using QDomElement, I did't have got that problemWhat I can do?
and what is the problem exactly?
I would like to be a "Guru"
Useful hints (try them before asking):
- Use Qt Assistant
- Search the forum
If you haven't found solution yet then create new topic with smart question.
My english sux very much...
For example:
If I change body section to: "Hej <someth" my application freezes.Qt Code:
<message from='test@jab.com/Jabber' type='chat' xml:lang='pl' to='test@jabbim.pl'><active xmlns='http://jabber.org/protocol/chatstates'/><body>Hey!</body></message>To copy to clipboard, switch view to plain text mode
I have not used the XML parser in Qt before, but other XML parsers would interpret the '<' symbol in the body as the opening to a tag. The parser would then read until it finds a closing '<' tag. Try converting the '<' to "<" and see if your program still hangs.
You can do the string conversion manually or for '<' and '>' with QString's replace string functions. There might be a method in one of the XML classes to quote characters that are meaningful to XML for you.
Well, he can't change the packet cause that's the way the server sends it.
My solution would be if you see the opening "body" tag, treat everything that follows as text untill you reach closing "body" tag. But that's not perfect cause someone could be chatting about HTML and send </body> and that would screw the parser up.
Last edited by Kill3rReaper; 5th August 2009 at 23:59.
Bookmarks