Results 1 to 10 of 10

Thread: Why Qxmlstreamreader returns pair of quotes and double empty lines beetween elements

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Why Qxmlstreamreader returns pair of quotes and double empty lines beetween eleme

    You are probably missing a readNext() call.
    Better put it at the beginning or the end of the loop.

    Cheers,
    _

  2. #2
    Join Date
    Mar 2015
    Posts
    125
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Why Qxmlstreamreader returns pair of quotes and double empty lines beetween eleme

    There are several readNext() 's- where I should put next one?
    Here is similar question but also without answer -
    http://www.qtcentre.org/threads/6454...ments?p=285154

  3. #3
    Join Date
    Mar 2015
    Posts
    125
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Why Qxmlstreamreader returns pair of quotes and double empty lines beetween eleme

    What would you do better in this situation (to extract the xml identically), if have not any suggestion concerning quotes?

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Why Qxmlstreamreader returns pair of quotes and double empty lines beetween eleme

    The example you post is not well formed XML. I would be surprised if it was written by QXmlStreamWriter.

    In all likelihood, the output at lines 2 and 3 is put there by line 25 of your code. QDebug added the quotes and between the quotes are the end of line character and leading spaces from two consecutive lines in the input file. QDebug is a debugging tool not a general purpose output generating tool. The quotes are useful to help tell the difference between an empty string "" and one containing only whitespace characters " ".

    If you want a general purpose text output stream then look at QTextStream.

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Why Qxmlstreamreader returns pair of quotes and double empty lines beetween eleme

    Quote Originally Posted by artt View Post
    There are several readNext() 's- where I should put next one?
    The readNext() statements are all in weird places.
    There should be only one at either the beginning or end that advances the stream.

    Cheers,
    _

  6. #6
    Join Date
    Mar 2015
    Posts
    125
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Why Qxmlstreamreader returns pair of quotes and double empty lines beetween eleme

    Really, in case of just one readnext() - in the beginning or the end of while loop we can have xml display -but the same in every detail - so my approach is correct and it doesnt influence the quotes - can I directly ask this question in trolltech team?

  7. #7
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Why Qxmlstreamreader returns pair of quotes and double empty lines beetween eleme

    You have already been told where the quotes came from and it has nothing to do with the QXmlStreamReader.

    Trolltech has not existed since circa 2008when it became part of Nokia and later the Qt Company

Similar Threads

  1. Replies: 7
    Last Post: 21st March 2014, 10:24
  2. Replies: 2
    Last Post: 5th December 2013, 06:35
  3. Replies: 1
    Last Post: 30th November 2013, 11:03
  4. Replies: 9
    Last Post: 22nd February 2013, 12:27
  5. Replies: 3
    Last Post: 27th December 2009, 00:00

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.