PDA

View Full Version : read "	" from xml file



mattia
18th February 2008, 10:35
Hello, i read a string in a xml file, the string is like this:

1	tre@rtetre	aaaaaaaa	aaaaaaaa

when i print it with qDebug() the "	" is substitute by a "tab" character, what should i do to read the raw string as is in xml file?
thx

marcel
18th February 2008, 14:01
The problem occurs when you load the string from the XML file. The parser will convert the "	" sequence to a "\t" sequence.

I believe that a solution is to parse the string right after you load it from the XML, and replace all "\t" appearances with "	". You should do this for all XML escaped sequences. See Canonical XML (http://www.w3.org/TR/1999/WD-xml-c14n-19991115.html), paragraph 5.2 for a list of escaped characters in XML.

jpn
18th February 2008, 15:44
Or use cdata?