Results 1 to 3 of 3

Thread: read "	" from xml file

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Thanks
    39
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default read "	" from xml file

    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

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: read "	" from xml file

    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, paragraph 5.2 for a list of escaped characters in XML.

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: read "	" from xml file

    Or use cdata?
    J-P Nurmi

Similar Threads

  1. read file from end to beginning..
    By soul_rebel in forum Qt Programming
    Replies: 11
    Last Post: 4th June 2012, 01:20
  2. How to read text only as it is from file
    By thomasjoy in forum Qt Programming
    Replies: 3
    Last Post: 9th August 2007, 08:47
  3. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  4. How to read line from file
    By Krishnacins in forum Newbie
    Replies: 10
    Last Post: 1st June 2006, 23:14
  5. Replies: 13
    Last Post: 1st June 2006, 14:01

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.