What is a well-formed document in XML?

Q2. What is a well-formed document?

Ans. A well-formed XML document is the one that follows XML guidelines and uses descriptive tags. In other words, an XML document is considered well-formed if all the tags follow XML guidelines and are in their proper places in the document. You need to keep the following guidelines in mind while creating a well-formed XML document:

  • The document must contain at least one element
  • Must have a root element
  • Elements must contain the opening and closing tags
  • Document must follow the correct tag order
  • XML tags must be case-sensitive
  • The values of the attributes must be in double quotes

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: