Site Feedback Thread

2 posts

XML Closing Tag

Back to Forum: Site Feedback
  • RamblingGeek​UK

    How do I close an XML tag with out the the full text?

    When I write out the xml file, it's written like so:-

    <Document>

    </Document>

    I want the ending tag not to contain the opening tag wording.... like so

    <Document>

    </>

    I'm new to writing out XML, any advice would be appreciated.   

    The reason I want to do this, is because I'm writing a small app that outputs some data to be read by another application (which I have no control), when I remove the tag text from the closing tag it reads the file fine, with it, it doesn't.

    Thanks in advance.

  • wkempf

    You can't do that. The closest XML comes is allowing you to open and close a tag at the same time:

    <Document />

    Otherwise you have to be explicit.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.