GarouDan
GarouDan

Reputation: 3833

XML. Just tag ending. What's this?

If I have a XML file like this one:

<?xml version='1.0' encoding='ISO-8859-1'?>
<data>
    <tag1>Some information</tag1>
    <tag2/>
</data>

Is it a common thing we have just the tag ending (at this case tag2)? This tells we don't have information stored on tag2 or this is an error on the XML file?

Upvotes: 1

Views: 88

Answers (1)

John
John

Reputation: 16007

Having </tag2> by itself, without a preceding opening <tag2>, is an error.

You can have an empty tag2 but it's written like this: <tag2 />

Upvotes: 2

Related Questions