I have a question about XML syntax. I know that the closing tag
looks like , but what does
mean? For example:
In your example,
<a>
<b>
<c/>
<d/>
</b>
</a>
<c/>
and <d/>
are empty element tags:
Empty-element tags may be used for any element which has no content, whether or not it is declared using the keyword EMPTY. For interoperability, the empty-element tag should be used, and should only be used, for elements which are declared EMPTY.
How would this XML tree look like?
The containment tree would be as shown above via indentation.
Is a
only going to have b
as a child?
Yes. b
and c
would be descendants, but not children, of a
.
Would b
also have c
and d
as children?
c
and d
are children of b
alone, not of a
.