Pablo's blog

A bit of this, a bit of that and a lot about computers

Closing tag in XML

I always wondered why they didn’t allow an optional closing tag of “</>” that would close the corresponding open tag.

For example:

<p>This is a string with something <b>bold</> in it.</p>

where “</>” is closing the <b> tag. Or:

<blah><bleh><blih><bloh>bluh</></></></>

which is shorter than:

<blah><bleh><blih><bloh>bluh</bloh></blih></bleh></blah>

I fell it is a shortcut like the stand-alone tag <tag/>.

Advertisement

Single Post Navigation

2 thoughts on “Closing tag in XML

  1. Yeah, you’re right, i wondered about this too. I can’t imagine where would this lead to problem.

  2. And let me mention that your example is wrong :)

    bluh

    is invalid, it should be
    bluh

    :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 332 other followers