XML Interview Questions and Answers – 4

151. Explain About The Mustunderstand Attribute?
This attribute indicates whether the header is optional or mandatory for the recipient to process. If you add mustUnderstand =”1” to the child element of the header element then it states that the header element must be processed otherwise it leads to failure.

152. Explain About The SOAP Body Element?
This part of the element will contain the message which is intended for the ultimate delivery point. An element can be described inside the body element as a default namespace which indicates about the error message during the process. SOAP element acts just like a code to be processed during the execution of a certain application.

153. Does The W3c Support Any Web Service Standards?
The World Wide Web Consortium (W3C) is actively pursuing standardization of Web service protocols. In September 2000, the W3C established an XML Protocol Activity. The goal of the group is to establish a formal standard for SOAP. A draft version of SOAP 1.2 is currently under review, and progressing through the official W3C recommendation process.
On January 25, 2002, the W3C also announced the formation of a Web Service Activity. This new activity will include the current SOAP work as well as two new groups. The first new group is the Web Services Description Working Group, which will take up work on WSDL. The second new group is the Web Services Architecture Working Group, which will attempt to create a cohesive framework for Web service protocols.

154. How Do I Get Started With Web Services?
The easiest way to get started with Web services is to learn XML-RPC. Check out the XML-RPC specification or read my book, Web Services Essentials. O’Reilly has also recently released a book on Programming Web Services with XML-RPC by Simon St.Laurent, Joe Johnston, and Edd Dumbill.
Once you have learned the basics of XML-RPC, move onto SOAP, WSDL, and UDDI. These topics are also covered in Web Services Essentials. For a comprehensive treatment of SOAP, check out O’Reilly’s Programming Web Services with SOAP, by Doug Tidwell, James Snell, and Pavel Kulchenko.

155. Describe The Role That XSL Can Play When Dynamically Generating Html Pages From A Relational Database.
Even if candidates have never participated in a project involving this type of architecture, they should recognize it as one of the common uses of XML. Querying a database and then formatting the result set so that it can be validated as an XML document allows developers to translate the data into an HTML table using XSLT rules. Consequently, the format of the resulting HTML table can be modified without changing the database query or application code since the document rendering logic is isolated to the XSLT rules.

156. Give A Few Examples Of Types Of Applications That Can Benefit From Using XML.
There are literally thousands of applications that can benefit from XML technologies. The point of this is not to have the candidate rattle off a laundry list of projects that they have worked on, but, rather, to allow the candidate to explain the rationale for choosing XML by citing a few real world examples. For instance, one appropriate answer is that XML allows content management systems to store documents independently of their format, which thereby reduces 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.

157. How Do I Override A Default Xml Namespace Declaration?
To override the current default XML namespace, you simply declare another XML namespace as the default. For example, in the following, the default XML namespace is the http://www.google.org/ namespace on the A and B elements and the http://www.bar.org/ namespace on the C and D elements. That is, the names A and B are in the http://www.google.org/ namespace and the names C and D are in the http://www.bar.org/ namespace.

<A xmlns=”http://www.google.org/”>
<C xmlns=”http://www.bar.org/”>

Using multiple default XML namespaces can lead to documents that are confusing to read and should be done carefully.

158. How Do I Override An Xml Namespace Declaration That Uses A Prefix?
To override the prefix used in an XML namespace declaration, you simply declare another XML namespace with the same prefix. For example, in the following, the google prefix is associated with the http://www.google.org/ namespace on the A and B elements and the http://www.bar.org/ namespace on the C and D elements. That is, the names A and B are in the http://www.google.org/ namespace and the names C and D are in the http://www.bar.org/ namespace.

<google:A xmlns:google=”http://www.google.org/”>
<google:C xmlns:google=”http://www.bar.org/”>

In general, this leads to documents that are confusing to read and should be avoided.

159. Where Can I Declare An Xml Namespace?
You can declare an XML namespace on any element in an XML document. The namespace is in scope for that element and all its descendants unless it is overridden.

160. What Is The Difference Between Versions 1.0 And 1.1 Of The Xml Namspaces Recommendation?
There are only two differences between XML namespaces 1.0 and XML namespaces 1.1:
. Version 1.1 adds a way to undeclare prefixes. For more information,
. Version 1.1 uses IRIs (Internationalized Resource Identifiers) instead of URIs. Basically, URIs are restricted to a subset of ASCII characters, while IRIs allow much broader use of Unicode characters.

161. What Is The Relationship Between Xml Namespaces And The Xml 1.0 Recommendation?
Although the XML 1.0 recommendation anticipated the need for XML namespaces by noting that element type and attribute names should not include colons, it did not actually support XML namespaces. Thus, XML namespaces are layered on top of XML 1.0. In particular, any XML document that uses XML namespaces is a legal XML 1.0 document and can be interpreted as such in the absence of XML namespaces.

162. Do Xml Namespaces Apply To Entity Names, Notation Names, Or Processing Instruction Targets?
No., XML namespaces apply only to element type and attribute names. Furthermore, in an XML document that conforms to the XML namespaces recommendation, entity names, notation names, and processing instruction targets must not contain colons.

163. Are The Names Of All Element Types And Attributes In Some Xml Namespace?
No., If an element type or attribute name is not specifically declared to be in an XML namespace — that is, it is unprefixed and (in the case of element type names) there is no default XML namespace — then that name is not in any XML namespace. If you want, you can think of it as having a null URI as its name, although no “null” XML namespace actually exists. For example, in the following, the element type name B and the attribute names C and E are not in any XML namespace:

<google:A xmlns:google=”http://www.google.org/”>
<B C=”bar”/>
<google:D E=”bar”/>

164. What Is An Xml Namespace?
An XML namespace is a collection of element type and attribute names. The collection itself is unimportant — in fact, a reasonable argument can be made that XML namespaces don’t actually exist as physical or conceptual entities . What is important is the name of the XML namespace, which is a URI. This allows XML namespaces to provide a two-part naming system for element types and attributes. The first part of the name is the URI used to identify the XML namespace – the namespace name. The second part is the element type or attribute name itself — the local part, also known as the local name. Together, they form the universal name. This two-part naming system is the only thing defined by the XML namespaces recommendation.

165. Can I Still Use Server-side Inclusions?
Yes, so long as what they generate ends up as part of an XML-conformant file (ie either valid or just well-formed). Server-side tag-replacers like shtml, PHP, JSP, ASP, Zope, etc store almost-valid files using comments, Processing Instructions, or non-XML markup, which gets replaced at the point of service by text or XML markup (it is unclear why some of these systems use non-HTML/XML markup). There are also some XML-based preprocessors for formats like XVRL (eXtensible Value Resolution Language) which resolve specialised references to external data and output a normalised XML file.

166. Can I (and My Authors) Still Use Client-side Inclusions?
The same rule applies as for server-side inclusions, so you need to ensure that any embedded code which gets passed to a third-party engine (eg calls to SQL, VB, Java, etc) does not contain any characters which might be misinterpreted as XML markup (ie no angle brackets or ampersands). Either use a CDATA marked section to avoid your XML application parsing the embedded code, or use the standard <, and & character entity references instead.

Sign-up for our email newsletter and get free job alerts, current affairs and GK updates regularly.
Subscribe Here (or)

Leave a Reply

Your email address will not be published. Required fields are marked *

three + = 12

Popup Dialog Box Powered By : XYZScripts.com
  • RSS
  • Facebook
  • Google+
  • Twitter