Professional Documents
Culture Documents
1) What is XML?
Extensible Markup Language (XML) is a structured format for storing and exchanging data across
different platforms and devices. XML contains User definable tags.
No, every tag in XML which is opened should have a closing tag.
Yes.
No, they both go together one is for describing data while other is for displaying data.
In DOM we load the whole XML document in to memory and then application manipulates the XML document.
But this is not always the best way to process large XML documents which have huge data elements.
17) In what scenarios will you use a DOM parser and SAX parser?
If you do not need all the data from the XML file then SAX approach is much preferred than DOM as
DOM can quiet memory intensive. In short if you need large portion of the XML document it’s better to
have DOM.
With SAX parser you have to write more code than DOM.
If you want to write the XML in to a file DOM is the efficient way to do it.
Some time you only need to validate the XML structure and do not want to retrieve any Data for
those instances SAX is the right approach.
During COM it was done by using MSXML 4.0. So old languages like VB6, VC++ used MSXML 4.0 which was
shipped with SP1 (Service Pack 1).
19) What is the main difference between MSXML and .NET Framework XML classes?
MSXML supports XMLDOM and SAX parsers while .NET framework XML classes support XML
DOM and XML readers and writers.
XML readers
With XML readers the client application gets reference to instance of reader class. Reader
class allows you to scroll forward through the contents like moving from node to node (or)
element to element. You can compare it with the SqlDataReader object in ADO.NET which is
forward only. In short XML reader allows you to browse through the XML document.
XML writers
Using XML writers you can store the XML contents to any other storage media. For instance
you want to store the whole in memory XML to a physical file or any other media.
XML documents provides a in memory representation for the data in an XMLDOM structure as
defined by W3C. It also supports browsing and editing of the document. So it gives you a
complete memory tree structure representation of your XML document.
XPath, the XML Path Language, is a query language for selecting nodes from an XML document. In addition,
XPath may be used to compute values (e.g., strings, numbers, or Boolean values) from the content of an
XML document.
24) What is the concept of XPOINTER?
The “XmlTextReader” class helps to provide fast access to streams of XML data in a forward-only and
read-only manner.
Represents a reader that provides document type definition (DTD), XML-Data Reduced (XDR) schema,
and XML Schema definition language (XSD) validation.