Logo F2FInterview

XML Interview Questions

Q   |   QA

The XPath is more of a path finder that gives out the logical way to a specific node. The other programming languages and implementations just take out the element and present it once to the programmer. With XPath the specific element’s path can be put to a lot more use than what other kind of object representations offer. There are also some mathematical functions that are offered for manipulation of data and paths withing the XPath. With extensibility and highly interpretable view over the entire document, XPath offers the programmer much logical information about data.

XQuery is used for querying the values found in the XML file as nodes. It is similar to the SQL language that is used for querying the databases for specific values. The XQuery is the one which is used to transform the XML data to a corresponding XHTML file. It is also used for getting the analytical data from the XML files.

The XSL and CSS are both similar in functionality, but the intended use for them are different. The XSL is more useful for formatting the raw XML data, which might involve complex data inferences. But the CSS is more meant for the dynamic styling and formatting of simple data. They can be used together in a tiered manner, where the XSL might be on an upper layer of interpretation of data and CSS might be the one that is styling the data obtained from the XSL translations and inferences.

Superficially, this is a fairly basic question. However, the point is not to determine whether candidates understand the concept of a parser but rather have them walk through the process of parsing XML documents step-by-step. Determining whether a non-validating or validating parser is needed, choosing the appropriate parser, and handling errors are all important aspects to this process that should be included in the candidate’s response.

Give some examples of XML DTDs or schemas that you have worked with.

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 DTDs 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 DTDs such as FpML, DocBook, HRML, and RDF, as well as experience designing a custom DTD for a particular project where no standard existed.

Using XSLT, how would you extract a specific attribute from an element in an XML document?

Successful candidates should recognize this as one of the most basic applications of XSLT. If they are not able to construct a reply similar to the example below, they should at least be able to identify the components necessary for this operation: xsl:template to match the appropriate XML element, xsl:value-of to select the attribute value, and the optional xsl:apply-templates to continue processing the document.

Extract Attributes from XML Data
Example 1.

<xsl:template match=”element-name”>

Attribute Value:

<xsl:value-of select=”@attribute”/>

<xsl:apply-templates/>

</xsl:template>

Every interview session should have at least one trick question. Although possible when using SGML, XML DTDs don’t support defining external entity references in attribute values. It’s more important for the candidate to respond to this question in a logical way than than the candidate know the somewhat obscure answer.

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: