Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. xml parsing
    Log in to post

    • SOLVED Can't see .xml file from build directory
      General and Desktop • qfile xml xml parsing console app • • BeaverShallBurn  

      6
      0
      Votes
      6
      Posts
      66
      Views

      @sierdzio, false alarm! After reopening my project everything got built and no file existance errors were present. Your hint about adding QCoreApplication really helped!
    • SOLVED Premature end of document with QXmlStreamReader
      General and Desktop • xml parsing qxmlstreamreade • • PaperMoon  

      3
      0
      Votes
      3
      Posts
      1935
      Views

      @jsulm Thank you so much! I modified the implementation based on your suggestion. And the error was resolved. For anyone landing at this question in the forum, Qt examples directory has a lot of examples for similar cases. I found 'RSS Listing example' (Examples/Qt-5.9.2/xml/rsslisting) to be helpful for my scenario.
    • SOLVED parsing binary xml with Qt
      General and Desktop • xml parsing qxmlstreamreade binary format • • ainu  

      11
      0
      Votes
      11
      Posts
      3167
      Views

      @mrjj thank you)
    • SOLVED How to parse xml with inline (embedded tags)?
      General and Desktop • xml xml parsing qxmlstreamreade • • billconan  

      12
      0
      Votes
      12
      Posts
      4019
      Views

      Again, it wasn't a suggestion, I was just asking whether you would simply do tag for tag replacement. Out of curiosity, since you are using doxygen, why not make it generate the html directly ?
    • UNSOLVED Best Way to Read XML Tags w/o Specifying Tag's Name
      General and Desktop • xml xml parsing xmllistmodel xmllist • • masshakar  

      3
      0
      Votes
      3
      Posts
      913
      Views

      Hi, Creating a very "abstract" xml parser is not easy and it's quite error-prone. You have to know some (or at least one) parent or common tag names in order to have a starting point for any deeper "abstract" parsing. Basically, you have to move the parser step by step checking everything in the way. For example, you could use a simple function as an entry point for the following function when you meet a specific tag: void XmlReader::readFragment() { Q_ASSERT(m_reader->isStartElement()); //Make sure the xmlreader is at an opening tag const QString p = m_reader->qualifiedName().toString(); // From now on, you will work with this opening tag //Do what you want, for example handle attributes and their values for (auto i = 0; i < m_reader->attributes().count(); ++i) { ... } m_reader->readNext(); //Move on ... //Do everything manually like this if (m_reader->isCharacters) { ... } else if (m_reader->isEndElement()) { ... } //or like this //Eventually, you have to check for the closing current tag, exit the function, //and return the control to the "entry point" function while (!m_reader->isEndElement() && !m_reader->qualifiedName().toString() == p) { ... //Do your work m_reader->readNext(); } } However, with this approach, things can get extremely complicated if there are nested tags, for example: <p> <note> <p>...</p> </note> </p> Maybe it would be easier to subclass QXmlStreamReader but it would help to provide some sample xml data and more info on what exactly you want to do.
    • SOLVED Problem with Read and Write XML File
      General and Desktop • qt 5.5 xml xml parsing • • Punit  

      10
      0
      Votes
      10
      Posts
      2950
      Views

      @the_ said: I for myself do not like this format... No-one does ^_^
    • UNSOLVED xml write with only space or empty issue
      General and Desktop • xml xml parsing qxml qdom qt4.8.4 • • Narthan  

      7
      0
      Votes
      7
      Posts
      3059
      Views

      @Paul-Colby i am opening xml file as you mentioned first time when i pressed save button it will show <?xml version='1.0'?> <xml> <tag1> </tag1> // two spaces from line edit </xml> second time when i presses save button it will show <?xml version='1.0'?> <xml> <tag1/> // some data in lineedit </xml> third time when i presses save button it will show <?xml version='1.0'?> <xml> <tag1/> // some data in lineedit </xml> i am using Qt 4.8.7, i am opening xml file , see the result
    • SOLVED Writing Subchild with DOM
      General and Desktop • xml parsing parse • • Aashu10  

      12
      0
      Votes
      12
      Posts
      2619
      Views

      @Aashu10 said: Thanks for replying, How do i check the return value of that. Sorry not so proficient with DomDocument. Have a look at the doc
    • UNSOLVED How to Parse an XML file using QDomDocument
      General and Desktop • xml parsing qdomdocument parse • • Rohith  

      4
      0
      Votes
      4
      Posts
      5833
      Views

      Like @Ratzz said. QXmlPutGet is very easy. QStringList list_IO; QXmlGet xml; xml.load(Sample.xml) xml.findAndDescend("General"); while(xml.findNext("IO") { list_IO = xml.getString(); } xml.rise();
    • Iterate over XML with QXmlStreamReader
      General and Desktop • xml xml parsing qxmlstreamreade • • moravas  

      3
      0
      Votes
      3
      Posts
      1842
      Views

      Hi, thank you very much, it was a really nice help. (Additionally, my XML file wasn't well formatted, but it's fixed). But there is one thing that I didn't see, how can I relaize: how can I insert a node into an existing XML file? Regards, Norbert
    • XmlListModel-XmlRole query problem
      QML and Qt Quick • qml listview qt 5.4 xml xml parsing xml model • • ceyhun  

      1
      0
      Votes
      1
      Posts
      854
      Views

      No one has replied

    • SOLVED Getting the first line of xml file using QDom
      General and Desktop • xml parsing • • tarod.net  

      7
      0
      Votes
      7
      Posts
      1955
      Views

      @p3c0 The same to you ;)
    • XML parser in QtScript
      Installation and Deployment • xml xml parsing qtscript • • fgdevel  

      1
      0
      Votes
      1
      Posts
      666
      Views

      No one has replied

    • [NEWBIE] simple XML reader - displaying text between tags.
      General and Desktop • xml parsing • • Godfreyho  

      4
      0
      Votes
      4
      Posts
      2000
      Views

      Hi Godfreyho, I don´t know if this is to take a sledgehammer to crack a nut for your intend, but if you want XML files to be parsed and output you can use a XSLT file with a xsl processor.