XML Interview Questions and Answers for Freshers and Experience Part-3
14. Describe the role that XSL can play while dynamically generating HTML pages from a relational database.
The SQLXML 3.0 and advanced versions provide the facility of mapping the SQL queries output with XSLT templates. It uses XSLT to present the records that are retrieved from databases on Web pages (HTML pages).
An application can use XSLT to modify the output that is retrieved from data sources and display the output by XSL templates. The XSLT displays data without affecting the database query and the code of application.
15. What are the advantages of DOM?
The following are the advantages of DOM:
DOM stores the entire XML document into memory before processing. Therefore, the XML structure can be easily modified and values can be added, changed, and removed.
DOM enables to traverse the XML structure in any direction. It means that you can access any node of the XML structure by traversing through the XML structure.
16. Give an example of a DOM-enabled XML parser.
The XML parser is MSXML, which is fully DOM-enabled.
17. What is an XML schema?
An XML schema provides the definition of an XML document. This implies that an XML schema defines the following in an XML document:
The elements that can appear in an XML document.
The attributes that can appear in an XML document.
The elements that are child elements.
The order of child elements.
The number of child elements.
Whether an element is empty or it includes some text.
The data types for elements and attributes.
18. State the advantages of XML schemas over DTD.
Microsoft developed a language known as the XML Schema Definition (XSD) to describe the schema to an XML document. The following are the advantages of XML schemas over DTDs:
XSD keeps much better control over types of data than the DTD.
DTD does not allow creating customized data types while the XSD provides full support to create customized data types.
XSD allows you to specify restrictions on data. It means that you can define the type of data that should be stored in an element, for example numbers or alphabets.
The XSD is quite easy to learn and to understand because its syntax is same as that of the XML document.