XML Tags


Most elements consist of a pair of opening and closing tags but there is another type of tag that can be used in XML documents.  The solo tag is used for elements that do not contain any text.  So instead of using the pair of tags, a modified opening tag is used.  In this case, a slash is used after the name of the element.  This tells the XML processor that the element has no data between opening and closing tags and that it has been completed.  The following example shows the syntax of this type of tag:

Example: <element />

Another thing to keep in mind when creating an XML document is that each XML tags must be closed in the order in which it was opened. So if another XML tag is opened inside another element it must be closed before the outer element is closed. If this rule is not followed, the XML processor will register an error.  Below are two examples of incorrect and then correct ways to nest XML elements.





<body>I love you!</body>



Example: CORRECT




<body>I love you!</body>



Though not required, the following practices are common:

  • Start a new line before placing a new tag.
  • If using a nested tag, indent the line to make it stand out.


Also, keep in mind that XML tags are case-sensitive.  So the tag <Man> is not the same as the tag <man>.  In addition to this, opening and closing tags must use the same case.  Examples of incorrect and correct case use is shown below:



<Name>This is not right</name>


Example: CORRECT

<name>This is not right</name>

This entry was posted in XML Tutorial. Bookmark the permalink.

44 Responses to XML Tags

  1. Mica Likos says:

    i do paid online surverys and also monetize my blogs, both are good sources of passive income”

  2. The great things about News became valuable to most of people.

  3. I’ve been absent for a while, but now I remember why I used to love this site. Thanks, I’ll try and check back more often. How frequently you update your website?

  4. Great, google took me stright here. thanks btw for this. Cheers!

  5. Good Morning, bing lead me here, keep up good work.

  6. Good, this is what I was searching for in yahoo

  7. just another says:

    uVWWhw Very informative article post.Thanks Again. Great.

  8. google bring me here. Cheers!

  9. For mac os says:

    I enjoying, will read more. Cheers!

  10. Just what I was looking for, regards for posting.

  11. Spot on with this write-up, I actually assume this website needs much more consideration. I?ll in all probability be again to read much more, thanks for that info.

  12. jav online says:

    It as hard to come by well-informed people about this subject, however, you sound like you know what you are talking about! Thanks

  13. Usually My spouse and i don at send ahead web sites, on the contrary I may possibly wish to claim that this particular supply in fact forced us to solve this. Fantastically sunny submit!

  14. I will right away snatch your rss feed as I can at to find your email subscription link or e-newsletter service. Do you have any? Please permit me know in order that I could subscribe. Thanks.

  15. It as nearly impossible to find well-informed people on this topic, however, you sound like you know what you are talking about! Thanks

  16. Gym Guide says:

    we came across a cool website that you just may possibly delight in. Take a search when you want

  17. Say, you got a nice article post. Really Cool.

  18. I only want to say I am just a starter to blogs and site-building and definitely I enjoy this web site. Certainly I am going to bookmark your website . You definitely include impressive web content and reviews. Thanks a lot for posting your blog.

  19. Gym Expert says:

    You have observed very interesting details ! ps nice web site. I understand a fury in your words, But not the words. by William Shakespeare.

  20. Thanks a lot for sharing this with all of us you actually know what you are talking about! Bookmarked. Please also visit my site =). We could have a link exchange agreement between us!

  21. longboard says:

    It is not my first time to pay a visit this web site, i am visiting this website dailly and take nice facts from here everyday.

  22. pes 2018 dll says:

    Good Day, glad that i stumble on this in yahoo. Thanks!

  23. Of course, what a fantastic site and revealing posts, I definitely will bookmark your website.Best Regards!

  24. This is very interesting, You are a very skilled blogger. I ave joined your rss feed and look forward to seeking more of your excellent post. Also, I have shared your web site in my social networks!

  25. Major thankies for the article post.Really thank you!

  26. Wow! Thank you! I always wanted to write on my site something like that. Can I include a fragment of your post to my website?

  27. dispensary says:

    Im obliged for the post.Thanks Again. Much obliged.

  28. Thanks for the article.Thanks Again. Great.

  29. Good, this is what I was browsing for in google

  30. I’а†ve recently started a blog, the info you provide on this website has helped me tremendously. Thanks for all of your time & work.

  31. it in. Check out this video with Daniel Klein, a chef and filmmaker who writes the Perennial Plate

  32. It as difficult to find well-informed people in this particular subject, however, you seem like you know what you are talking about! Thanks

  33. It as hard to find educated people about this subject, however, you seem like you know what you are talking about! Thanks

  34. Thanks for the blog article.Really looking forward to read more. Will read on

  35. Thank you ever so for you article post.Much thanks again. Fantastic.

  36. Thanks-a-mundo for the blog article.Much thanks again. Cool.

  37. I simply could not leave your site prior to suggesting that I extremely enjoyed the standard information a person supply to your visitors? Is going to be back incessantly to inspect new posts

  38. This awesome blog is no doubt entertaining and also diverting. I have picked helluva helpful things out of this blog. I ad love to return every once in a while. Cheers!

  39. Health Blog says:

    I will immediately grab your rss as I can at find your e-mail subscription link or e-newsletter service. Do you ave any? Please let me know so that I could subscribe. Thanks.

  40. Thankyou for this wonderful post, I am glad I detected this site on yahoo.

  41. Ujala Scheme says:

    This awesome blog is obviously educating and besides diverting. I have picked a bunch of interesting things out of it. I ad love to come back again and again. Thanks!

  42. This very blog is really cool as well as amusing. I have discovered a bunch of helpful things out of it. I ad love to visit it every once in a while. Thanks a lot!

Leave a Reply

Your email address will not be published.