XML Interview Questions

XML Interview Questions

XML The Extensible Markup Language is a general-purpose specification for creating custom markup languages. It improves the functionalityof the Web by letting you identify your information in a more accurate,flexible, and adaptable way. XML is actually a meta language, language for describing

other language, which lets you design your own markup languages for limitless different types of documents.

It is extensible because it is not a fixed format like HTML (which is a single, predefined markup language). It is classified as an extensible language because it allows its users to define their own elements.

Primary purpose of XML is to help information systems share structured data, particularly via the Internet. XML is used both to encode documents and to serialize data.

XML started as a simplified subset of the Standard Generalized Markup Language (SGML), and is designed to be relatively human-legible. By adding semantic constraints, application languages can be implemented in XML. These include XHTML, RSS, MathML, GraphML, Scalable Vector Graphics, MusicXML, and thousands of others. Moreover, XML is sometimes used as the specification language for such application languages.In the latter context, it is comparable with other text-based serialization languages such as JSON and YAML.

There are literally thousands of applications that can benefit from XML technologies. For instance XML allows content management systems to store documents independently of their format thereby reducing data redundancy. Another answer relates to B2B exchanges or supply chain management systems. In these instances, XML provides a mechanism for multiple companies to exchange data according to an agreed upon set of rules. A third common response involves wireless applications that require WML to render data on hand held devices.

Although XML does not require data to be validated against a DTD, many of the benefits of using the technology are derived from being able to validate XML documents against business or technical architecture rules. Polling for the list of DTD’s that developers have worked with provides insight to their general exposure to the technology. The ideal candidate will have knowledge of several of the commonly used DTD’s such as FpML, ebML, DocBook, HRML and RDF, as well as experience designing a custom DTD for a particular project where no standard existed.

1) Explain what is a Markup Language ?

A markup language is a set of words and symbols for describing the identity of pieces of a document (for example ?this is a paragraph?, ?this is a heading?, ?this is a list?, ?this is the caption of this figure?,

etc). Programs can use this with a style sheet to create output for screen, print, audio, video, Braille, etc.

2.) Differences between XML and HTML.

Answer -It’s amazing how many developers claim to be proficient programming with XML, yet do not understand the basic differences between XML and HTML. Anyone with a fundamental grasp of XML should be able describe some of the main differences outlined in the table below:

Differences Between XML and HTML

XML

User definable tags

Content driven

End tags required for well formed documents

Quotes required around attributes values

Slash required in empty tags

HTML

Defined set of tags designed for web display

Format driven

End tags not required

Quotes not required

Slash not required

3) DOM and how does it relate to XML?

The Document Object Model (DOM) is an interface specification maintained by the W3C. DOM Workgroup that defines application independent mechanism to access, parse or update XML data. It simple terms it is hierarchical model that allows developers to easily manipulate XML documents. Any developer that has worked extensively with XML should be able to discuss the concept and use of DOM objects freely. Additionally, it is not unreasonable to expect advanced candidates to thoroughly understand its internal workings and be able to explain how DOM differs from event based interface specifications such as SAX.

4) What is SOAP and how does it relate to XML?

OAP consists of three components: an envelope, a set of encoding rules, and a convention for representing remote procedure calls. The Simple Object Access Protocol (SOAP) uses XML to define a protocol for the exchange of information in distributed computing environments. Unless experience with SOAP is a direct requirement for the open position, knowing the specifics of the protocol or how it can be used in conjunction with HTTP is not as important as identifying it as a natural application of XML.