What is 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 an application independent mechanism to access, parse, or update XML data. In simple terms it is a hierarchical model that allows developers to manipulate XML documents easily. 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 an event-based interface like SAX.
What is SOAP and how does it relate to XML?
The Simple Object Access Protocol (SOAP) uses XML to define a protocol for the exchange of information in distributed computing environments. SOAP consists of three components: an envelope, a set of encoding rules, and a convention for representing remote procedure calls. 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.
Why is XML such an important development?
It removes two constraints which were holding back Web developments:
1. § dependence on a single, inflexible document type (HTML) which was being much abused for tasks it was never designed for;
2. the complexity of full SGML, whose syntax allows many powerful but hard-to-program options.
§ XML allows the flexible development of user-defined document types. It provides a robust, non-proprietary, persistent, and verifiable file format for the storage and transmission of text and data both on and off the Web; and it removes the more complex options of SGML, making it easier to program for.
The Document Object Model (DOM) is an interface specification maintained by the W3C DOM Workgroup that defines an application independent mechanism to access, parse, or update XML data. In simple terms it is a hierarchical model that allows developers to manipulate XML documents easily. 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 an event-based interface like SAX.
What is SOAP and how does it relate to XML?
The Simple Object Access Protocol (SOAP) uses XML to define a protocol for the exchange of information in distributed computing environments. SOAP consists of three components: an envelope, a set of encoding rules, and a convention for representing remote procedure calls. 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.
Why is XML such an important development?
It removes two constraints which were holding back Web developments:
1. § dependence on a single, inflexible document type (HTML) which was being much abused for tasks it was never designed for;
2. the complexity of full SGML, whose syntax allows many powerful but hard-to-program options.
§ XML allows the flexible development of user-defined document types. It provides a robust, non-proprietary, persistent, and verifiable file format for the storage and transmission of text and data both on and off the Web; and it removes the more complex options of SGML, making it easier to program for.
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 question 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.
Can you walk me through the steps necessary to parse XML documents?
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.
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(true);
DocumentBuilder domBuilder = factory.newDocumentBuilder();
Document doc = domBuilder.parse(XMLFile);
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.
Is it possible to write the contents of org.w3c.dom.Document object into an .xml file?
Yes its possible. One to achieve this is by using Xerces. Xerces is an XML parser. You would use the following code
org.apache.xml.serialize.OutputFormat format = new org.apache.xml.serialize.OutputFormat(myDocument);
org.apache.xml.serialize.XMLSerializer output = new org.apache.xml.serialize.XMLSerializer(new FileOutputStream(new File("test.xml")), format);
output.serialize(myDocument);
What is the difference between DOM and SAX? What would you use if an option is given?
DOM parses an XML document and returns an instance of org.w3c.dom.Document. This document object's tree must then
be "walked" in order to process the different elements. DOM parses the ENTIRE Document into memory, and then makes it
available to you. The size of the Document you can parse is limited to the memory available.
SAX uses an event callback mechanism requiring you to code methods to handle events thrown by the parser as it
encounters different entities within the XML document. SAX throws events as the Document is being parsed. Only the
current element is actually in memory, so there is no limit to the size of a Document when using SAX.
The specific parser technology that will be used will be determined by the requirements of your application. If you need the
entire document represented, you will most likely use DOM builder implementation. If you only care about parts of the
XML document and/or you only need to parse the document once, you might be better served using SAX implementation.
What is SOAP?
The Simple Object Access Protocol (SOAP) uses XML to define a protocol for the exchange of information in distributed computing environments. SOAP
consists of three components: an envelope, a set of encoding rules, and a convention for representing remote procedure calls.
What is DOM?
The Document Object Model (DOM) is an interface specification maintained by the W3C DOM Workgroup that defines an application independent mechanism
to access, parse, or update XML data. In simple terms it is a hierarchical model that allows developers to manipulate XML documents easily.
Is it necessary to validate XML file against a DTD?
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.
What is XPath?
XPath stands for XML Path Language
XPath is a syntax for defining parts of an XML document
XPath is used to navigate through elements and attributes in an XML document
XPath contains a library of standard functions
XPath is a major element in XSLT
XPath is designed to be used by both XSLT and XPointer
XPath is a W3C Standard
What is XSL?
XSLT - a language for transforming XML documents
XSLT is used to transform an XML document into another XML document, or another type of document that is recognized by a browser, like HTML and XHTML.
Normally XSLT does this by transforming each XML element into an (X)HTML element.
What is a DTD and a Schema?
The XML Document Type Declaration contains or points to markup declarations that provide a grammar for a class of documents. This grammar is known as a
document type definition or DTD.
The DTD can point to an external subset containing markup declarations, or can contain the markup declarations directly in an internal subset, or can
even do both.
A Schema is:
XML Schemas express shared vocabularies and allow machines to carry out rules made by people. They provide a means for defining the structure, content
and semantics of XML documents.
Schemas are a richer and more powerful of describing information than what is possible with DTDs.
There are literally thousands of applications that can benefit from XML technologies. The point of this question 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.
Can you walk me through the steps necessary to parse XML documents?
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.
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(true);
DocumentBuilder domBuilder = factory.newDocumentBuilder();
Document doc = domBuilder.parse(XMLFile);
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.
Is it possible to write the contents of org.w3c.dom.Document object into an .xml file?
Yes its possible. One to achieve this is by using Xerces. Xerces is an XML parser. You would use the following code
org.apache.xml.serialize.OutputFormat format = new org.apache.xml.serialize.OutputFormat(myDocument);
org.apache.xml.serialize.XMLSerializer output = new org.apache.xml.serialize.XMLSerializer(new FileOutputStream(new File("test.xml")), format);
output.serialize(myDocument);
What is the difference between DOM and SAX? What would you use if an option is given?
DOM parses an XML document and returns an instance of org.w3c.dom.Document. This document object's tree must then
be "walked" in order to process the different elements. DOM parses the ENTIRE Document into memory, and then makes it
available to you. The size of the Document you can parse is limited to the memory available.
SAX uses an event callback mechanism requiring you to code methods to handle events thrown by the parser as it
encounters different entities within the XML document. SAX throws events as the Document is being parsed. Only the
current element is actually in memory, so there is no limit to the size of a Document when using SAX.
The specific parser technology that will be used will be determined by the requirements of your application. If you need the
entire document represented, you will most likely use DOM builder implementation. If you only care about parts of the
XML document and/or you only need to parse the document once, you might be better served using SAX implementation.
What is SOAP?
The Simple Object Access Protocol (SOAP) uses XML to define a protocol for the exchange of information in distributed computing environments. SOAP
consists of three components: an envelope, a set of encoding rules, and a convention for representing remote procedure calls.
What is DOM?
The Document Object Model (DOM) is an interface specification maintained by the W3C DOM Workgroup that defines an application independent mechanism
to access, parse, or update XML data. In simple terms it is a hierarchical model that allows developers to manipulate XML documents easily.
Is it necessary to validate XML file against a DTD?
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.
What is XPath?
XPath stands for XML Path Language
XPath is a syntax for defining parts of an XML document
XPath is used to navigate through elements and attributes in an XML document
XPath contains a library of standard functions
XPath is a major element in XSLT
XPath is designed to be used by both XSLT and XPointer
XPath is a W3C Standard
What is XSL?
XSLT - a language for transforming XML documents
XSLT is used to transform an XML document into another XML document, or another type of document that is recognized by a browser, like HTML and XHTML.
Normally XSLT does this by transforming each XML element into an (X)HTML element.
What is a DTD and a Schema?
The XML Document Type Declaration contains or points to markup declarations that provide a grammar for a class of documents. This grammar is known as a
document type definition or DTD.
The DTD can point to an external subset containing markup declarations, or can contain the markup declarations directly in an internal subset, or can
even do both.
A Schema is:
XML Schemas express shared vocabularies and allow machines to carry out rules made by people. They provide a means for defining the structure, content
and semantics of XML documents.
Schemas are a richer and more powerful of describing information than what is possible with DTDs.
No comments:
Post a Comment