Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Need closing element name
Forum Updated to NodeBB v4.3 + New Features

Need closing element name

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 181 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gabello306
    wrote on last edited by
    #1

    When I use QXmlStreamWriter, I can start an element with writeStartElement which will the name of the starting element. If I have no children under this element then when I close it with writeEndElement it just puts a slash on the starting element. An example below.
    If there is a child:

    <test>
        <value/>
    </test>
    

    if there is no child

    <test/>
    

    What I would like:

    <test>
    </test>
    
    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Then you have to create your xml by yourself. Since there is no semantic difference between those two there is no need to provide an option for the latter.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      2
      • G Offline
        G Offline
        gabello306
        wrote on last edited by
        #3

        That is what I thought. Thanks for the confirmation.

        1 Reply Last reply
        0
        • G gabello306 has marked this topic as solved on

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved