Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. Create XML element without closing tag using Visual C++

Create XML element without closing tag using Visual C++

Scheduled Pinned Locked Moved Visual Studio
c++xmltutorialquestion
3 Posts 2 Posters 3 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.
  • A Offline
    A Offline
    adamay
    wrote on last edited by
    #1

    I know how to create xml element with closing tag (using WriteStartElement and WriteEndElement methods)

    <tag id="1234">
    </tag>

    but is there a way in Visual C++ to produce xml element like this

    <tag id="1234"/>

    i.e. without closing tag?

    S 1 Reply Last reply
    0
    • A adamay

      I know how to create xml element with closing tag (using WriteStartElement and WriteEndElement methods)

      <tag id="1234">
      </tag>

      but is there a way in Visual C++ to produce xml element like this

      <tag id="1234"/>

      i.e. without closing tag?

      S Offline
      S Offline
      Shao Voon Wong
      wrote on last edited by
      #2

      WriteEndElement should have detected the element has no child or text and close it properly. What library are you using?

      A 1 Reply Last reply
      0
      • S Shao Voon Wong

        WriteEndElement should have detected the element has no child or text and close it properly. What library are you using?

        A Offline
        A Offline
        adamay
        wrote on last edited by
        #3

        Thank you for your reply. I made mistake, because I was actually using WriteFullEndElement, and not WriteEndElement (as I mentioned before). WriteEndElement is what I needed for this. Thanks again!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups