MENU
Question -

A well-formed document must have a root element. Explain with an example.



Answer -

To create a well-formed XML document, it is necessary for it to have a root element. A root element is a unique element that contains all other elements in the XML document.
The XML document cannot contain more than one root element.
The following code is an example of a well-formed document:

Delhi
Delhi
India
Consider the same code written in the following way: 
Delhi
Delhi
India
The preceding code is not a well-formed document, since it does not contain a root element.

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×