Results 1 to 12 of 12

Thread: Read local xml file

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2014
    Posts
    116
    Thanks
    8
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Read local xml file

    Hi,

    finally I managed to download and save a xml file to my disk. Now I would like to find a specific element in this xml file. I managed to open it in QML using JS (how to) but I am just not able to access the content of the nodes. What is the right syntax to access these information from the for loop?
    Qt Code:
    1. <xml>
    2. <termin type="1">
    3. <datum>1449939600</datum>
    4. <art>BA</art>
    5. <thema>Feier</thema>
    6. <anmerkung/>
    7. </termin>
    8. <termin type="2">
    9. <datum>1450458000</datum>
    10. <art>Supervision</art>
    11. <thema>Supervision</thema>
    12. <anmerkung/>
    13. </termin>
    14. </xml>
    To copy to clipboard, switch view to plain text mode 

    For example console.log(a[ii].getElementsByTagName("datum")[0].childNodes[0].nodeValue); says TypeError: Cannot call method 'getElementsByTagName' of undefined
    What am I doing wrong?
    Last edited by KeineAhnung; 7th December 2015 at 16:41.

Similar Threads

  1. QWebEngineSettings allow local file write?
    By RolandHughes in forum Qt Programming
    Replies: 3
    Last Post: 25th June 2015, 15:56
  2. read out local printer
    By Qiieha in forum Qt Programming
    Replies: 1
    Last Post: 2nd November 2011, 19:15
  3. local file path
    By sky in forum Newbie
    Replies: 3
    Last Post: 20th January 2011, 08:59
  4. Replies: 1
    Last Post: 22nd December 2010, 17:56
  5. Password on local file/folder
    By icebox25 in forum Qt Programming
    Replies: 3
    Last Post: 13th April 2007, 16:33

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.