Results 1 to 3 of 3

Thread: QDomProcessingInstruction

  1. #1
    Join Date
    Jan 2006
    Location
    Hannover, Germany
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default QDomProcessingInstruction

    Hi all,

    I've read through all the xml stuff in the documentation, but I still can't figure out how to add <?xml version='1.0' encoding='UTF-8'?> to my QDomDocument. Has anyone already done this?

    Greets,
    Weilor

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

    Default Re: QDomProcessingInstruction

    I'm not exactly sure if there's a better way but maybe this is sufficient for you:
    Qt Code:
    1. QDomProcessingInstruction pi = doc.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'");
    2. doc.appendChild(pi);
    3. ...
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  3. The following 2 users say thank you to jpn for this useful post:

    giotto (15th February 2008), Weilor (4th July 2007)

  4. #3
    Join Date
    Jan 2006
    Location
    Hannover, Germany
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: QDomProcessingInstruction

    Perfect! Thanks a lot.

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.