Home >>Interview Questions >XML Interview Questions

XML Interview Questions

XML Interview Questions

Questions and answers from XML interviews are given which have been asked in other companies. Let's see the compilation of top 25 XML queries from the interview.

1. What is XML?

XML stands for the language of the eXtensible Markup. It is a simple, flexible language for markups. It is recognized for data on the web as a common language, since XML documents can be generated and used in any language. It is universal standard for the sharing of information.

XML technology helps you to build your own language for markups.

2. What is XML DOM?

DOM stands for Document Object Model which is used to describe XML document's logical structure. It's a hierarchical model that provides a way to manage and navigate an XML document.

Any language such as C #, VB, JavaScript and VB Script can use DOM methods and objects.

3. What is DTD?

DTD stands for description of type of document. A leading building block of an XML document is specified. This does define:

  • Names of elements
  • How and where they can be used
  • Element attributes
  • Proper nesting

4. What is XSLT?

XSLT is a common XML technology that converts one XML file into another document, such as HTML etc. XSLT is like a language for the transformation of XML documents that has its own syntax, functions and operator. XSLT is often known as the HTML pages for viewing data present in XML files.

5.How XML is different from HTML?

HTML stands for the Hyper Text Markup Language, while XML stands for the markup language eXtensible. Here are the main distinctions between HTML and XML:

1. HTML is used to display data and to focus on the look of the data. XML is an independent software and hardware tool used for the data transmission and storage. It focuses on what defines data.
2. HTML itself is a markup language. XML offers a basis for specifying languages for the markup.
3. HTML is not case sensitive. XML is case sensitive.
4. HTML is a presentation language. XML is neither a presentation language nor a programming language.

6. What is the meaning of version in XML?

Version is a tag that shows which version of XML is being used.

7.Is XML meant to be a replacement of HTML?

No, the two languages have their own specifications and are used for various purposes. XML is used to describe data but while HTML focuses on displaying data.

8. What are the benefits of XML?

The key benefits of using XML are those.

Simplicity:The knowledge stored in XML is really simple to read and understand.

Openness:It is a W3C standard which is endorsed by market leaders in the software industry.

Extensibility: Extensible because it doesn't have a fixed set of tags. You can describe them however you like.

Self-descriptive: XML documents do not require unique schema configurations to store data like traditional databases. Without these concepts XML documents may be processed as they include metadata in the form of tags and attributes.

Scalable: XML is not in binary format so that you can create and edit files with anything, and debugger is easy too.

Fast access: XML documents are hierarchically arranged and it's comparatively easier.

9. What is SAX in XML?

SAX stands for Simple XML API. It is a parser with sequential access. It is a simple XML API which provides a data reading mechanism from an XML document. This is a DOM replacement. DOM works on the documents as a whole, SAX parsers work sequentially on each component of the XML document.

SAX does not have any formal specification like DOM and consumes fewer memory. But this can be used to only not compose the XML document.

10. What is XSNL?

XSNL is a language neutral to XML search. It language works as guided system and meta search interface.

11.What is XPath in XML?

XPath is an XML-type technology. Used for removing items from XML documents. Since XML documents are structured, XPath expressions may be used to find and extract objects, attributes and values from XML data. It's similar to SQL.

Since SQL is used to get data from the database, XPath is used to get data from XML.

12. What is a well formed XML document?

A syntactically formed XML document is considered a syntactically correct document. Does the XML need to follow a well defined XML document? Simple syntax rules:

  • This needs to have a tag that locks.
  • The closing tag will match the open tag with precision: XML is case sensitive.
  • All components are to be used in one root tag.
  • Child components under parent tag must be closed.

13.What is a valid XML document?

A valid XML document is termed a structurally correct element. It should follow certain predefined rules for a particular type of document. These rules determine the type of data which can comprise each part of the document. The author of an XML document or someone else can write those rules.

14. What is XML encoding error?

There are two types of errors about XML encoding:

  • The text content included an invalid character.
  • Switching from the current encoding to unsupported specified encoding.

It is because XML document can include non-ASCII characters such as Norwegian and French. You can avoid such errors by specifying the Unicode XML encoding.

15. How can you apply a DTD to an XML document?

You can: To add a DTD to an XML document.

  • Using the description of DTD elements inside the XML document itself.
  • Provide a DTD as a separate file and in XML document reference its name.

16. What are the basic rules to write XML document?

You should consider writing an XML document with the following rules.

  • It will have to have a root element.
  • Both tags have to be closed.
  • Spaces are not allowed with tag names.
  • All tags must be properly nested.
  • Case-sensitive XML tags.
  • Use the values of the attributes within quotes.
  • In XML, whitespace is preserved.

17. What is XSL?

XSL stands for the language of Extensible Stylesheets. It is a language used to express stylesheets. Such stylesheets are identical to CSS, which specifies how to view a given type of XML document.

18. What is the difference between XML DTD and XML schema or XSD?

XSL stands for the language of Extensible Stylesheets. It is a language used to express stylesheets. Such stylesheets are identical to CSS, which specifies how to view a given type of XML document.

  • DTD stands for description of document type while XSD stands for definition of XML schema.
  • The DTD allows no namespaces. To define a schema, it has its own set of keywords while XSD uses its own set of namespaces and elements to define the schema.
  • DTD is the predecessor to XML schema because XML schema is a new technology, it is not yet supported by any XML parsers.

19.Define element and attribute in an XML document.

All you see in an XML document is XML element, from the start tag to the end tag. This may be comprised of other elements, attributes and texts.

An Attribute is a definition used to define additional element detail.

Let's take an example to understand it well:

<student id="1">  

In the above example, <student> is an element and id is an attribute of the <student> element.

20. What is the difference between simple element and complex element?

Simple elements in XML are items based on a text. It has less attributes, less child elements and can not be left empty.

Complex elements can therefore hold multiple attributes and elements. It can also include additional sub-elements and empty-element.

21. Define the concept of XPOINTER.

XPOINTER is used for pointing data to XML document. The actual part of the XML document is located with it. It is approved by the W3C.

See this example:

address.xml#pointer(/ descendant ::streetnumber[@id =9])

In this example, XPOINTER points "streetnumber = 9" in "address.xml".

22. What is XML data binding? Why is it used?

XML data binding is the process through which the information in the XML document is interpreted as an object in computer memory.

Binding XML data is used to reduce the development effort, simplify maintenance, increase reliability. It's saving time and money on your growth. It makes the XML data very intuitive to work with.

23.What is XML Namespace?

A document may contain duplicate elements and attributes. Therefore, namespace specifies a means of comparing similar items and names of the attributes.

24. What are the different XML API's?

Tree-based API: It compiles and loads an XML document into the memory in a tree-like structure. You may traverse the tree structure, and alter it. Tree-based API's are useful for a wide range of uses. DOM parser is an example of a Tree-based API.

Event-based API: An event-based API delivers the information surrounding the parsing case to an application. This requires an integrated collection of callback features. SAX parser is an example of event-based API.

25. What is XmlReader class? Explain.

The XmlrReader class is a reader which provides fast, non-cached, forward-only access to XML data. To function with XmlReader class in.NET you will import the following namespaces.

In VB:

Imports System.Xml

In C#:

using System.Xml;

26. What is SGML?

SGML is a detailed and efficient generalized markup language used to describe definitions for structuring several electronic documents.

27. What is the difference between CDATA and PCDATA?

CDATA means data of unparsed characters whereas PCDATA is data of parsed characters.

28.What is XQuery?

XQuery is a query language used for recovering data from XML document.

29. Is XML case sensitive?

Yes, XML is a case sensitive language.

No Sidebar ads