Results 1 to 1 of 1

Thread: Parsing the xml namespace

  1. #1
    Join Date
    Jan 2014
    Posts
    76
    Thanks
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Parsing the xml namespace

    Hi,
    I have problem with QDomDocument and parsing xml namespace. The following xml element
    Qt Code:
    1. <d:prop>
    To copy to clipboard, switch view to plain text mode 

    for tagName() give me
    Qt Code:
    1. "d:prop"
    To copy to clipboard, switch view to plain text mode 
    but for localName() and prefix() give me empty string why?
    What I am doing wrong here?


    Added after 7 minutes:


    Second parameter of setContent() must be set to true for namespace processing...

    so
    Qt Code:
    1. QDomDocument xmlDocument;
    2. xmlDocument.setContent(xmlContent, true);
    To copy to clipboard, switch view to plain text mode 

    I hope this can help someone else with similar problem.
    Last edited by atomic; 28th September 2015 at 11:55.

Similar Threads

  1. Qt namespace Ui
    By ehnuh in forum Qt Programming
    Replies: 3
    Last Post: 15th October 2012, 10:27
  2. Xml namespace parsing using QXmlStreamReader
    By matsukan in forum Qt Programming
    Replies: 1
    Last Post: 7th October 2012, 10:10
  3. Example use namespace
    By giorgik in forum Newbie
    Replies: 4
    Last Post: 19th June 2012, 22:03
  4. using namespace VS using
    By jryans10 in forum General Programming
    Replies: 1
    Last Post: 7th January 2012, 22:23
  5. QTM namespace
    By Aman607 in forum Qt Programming
    Replies: 1
    Last Post: 13th June 2011, 08: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.