Following are some practice questions fetched from different sources on the web.
- An XML tree contains several different kinds of node? List and briefly explain them
a. Root node: contains the entire document
b. Element: contains attributes and has a start and end tag
c. Text: content between start and end tags
d. Comment: ignored by parser
e. Processing Instruction: information for the application using XML document - What is the function of a parser?
Parser processes the XML document. It verifies whether the document is well-formed. If the document is well-formed, the parser would extract its data, converting it to Unicode. - What is an instance document?
There are many types of XML documents used for transforming and validating data. An XML document which contains actual data is called an instance document. - How is XML extensible?
It allows users to define their own tags. - How is XML robust?
It allows users to add new kinds of elements without compromising the processing of the existing elements - How does element differ from tag?
A tag is an identifier enclosed in < and > symbols. Tag can enclose text. A element is the ensemble of text and tags - What is a mixed content element?
It contain both text and child(ren) - What is a mixed content element?
It contain both text and child(ren) - Explain the purpose of the encoding attribute and its effect on parsing
Encoding attribute specifies the type of encoding used in the document. Parser uses this information to convert to Unicode. - What is the purpose of an element's attributes?
Attributes further define properties of an XML tag.