Misra’s blog

  • Advertisements

XML interview questions

Posted by mtwinkle on May 18, 2006

Q1. Describe the differences between XML and HTML
Ans 1.
HTML: Display data and to focua on how data looks
XML : Describe data and to focus on what data is.

Another major difference is : XML document is always constrained to be well-formed.

Q2. Give a few examples of types of applications that can benefit from using XML.
a. XML allows content management systems to store documents independently of their format, which thereby reduces data redundancy.
b. Another example is 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

Q3. Explain DOM
Ans3. DOM presents the XML document as a tree structure.

Q4. Explain SAX

Q5. Difference between DOM & SAX parser
Ans 5.
DOM and SAX are two standard Java application programming interfaces (APIs) for parsing XML dataSAX defines events that can occur as a parser is reading through an XML document, such as the start or the end of an element. For example, a programmer might decide to stop parsing an XML document as soon as the parser encounters an error that indicates that the document is invalid, rather than waiting until the entire document is parsed, thus improving performance. DOM reads an XML document into memory and represents it as a tree; each node of the tree represents a particular piece of data from the original XML document. Because the tree structure is a standard programming mechanism for representing data, traversing and manipulating the tree using Java is relatively easy, fast, and efficient. The main drawback, however, is that the entire XML document has to be read into memory for DOM to create the tree, which might decrease the performance of an application as the XML documents get larger.

Q6. Necessary steps required to parse XML documents

Q7. Define XSLT and XPath
XSL: is a stylesheet language for XML
XSL Transformations (XSLT): a language for transforming XML documents into other types of documents, including other XML documents
XML Path Language (XPath): a language used by XSLT to access or refer to parts of an XML document
XLink: is a Language, which allows elements to be inserted into XML documents in order to create and describe links between resources

Q8. Disadvantages of DTD’s
a. They are written in different (non-XML) syntax.
b. They have no support for namespaces.
c. They only offer limited datatyping. DTDs can only express the datatype of attributes in terms of explicit enumerations and a few coarse string formats, there’s no facility for describing numbers, dates, currency values, and so forth.

Q9. Advantages of XML
ANs 9.
XML is a :
a. Text-based, Meta-markup language.
b. Platform independent
c. Fast becoming the standard for data interchange on the web

Q10. What are Entities?
Ans 10. Entities are like macros – it is a set of information that can be used by calling one name.

Every time the string &name appears in the XML code, it will be replaced by the replacement text specified.

Q11. Types of entities?
Ans 11.
a. General Entity: that you define in DTD and use in a document.

use it as &name;

b. Parameter Entity: that you define and use in a DTD

use it as %name
Q12. What does this indicate?

If you are defining an entity in an external ASCII text file, put in a pointer to the external file.

Q13. Explain PCDATA & CDATA?
Ans 13.

Q14. Why do we use namespaces?
Ans 14. XML namespaces allows tags to have context. That context is the tags’s XML namespace, which is simply a web address. Since web address’s are unique,they are used to establish unique contexts.
You can specify a default namespace at the start of the document. ANy tags without prefixes are assumed to be in the deafult namesapce.

Uses: When two documents make use of same tag names in different contexts.
eg. tag in catalog and in a dramatic play.

Q15. What is a parser?
Ans 15. A parser is a s/w to check whether XML document is:
a. Well-formed (follows some basic syntax rules)
b. Valid (follows the structure mentioned in DTD/Schema)

Q16. Well-formed?
Ans 16.
a. All XML documents must have a root tag
b. XML tags are case sensitive
c. All XML elements must have a closing tag
d. Attribute values must always be quoted
e. Elements must properly nest within each other.

Ans 17.

2 Responses to “XML interview questions”

  1. You can undoubtedly see your skills within the function you write. The world hopes for a lot more passionate writers like you who arent afraid to say how they believe. At all times follow your heart 136500

  2. Safest the world toasts are created to captivate and also faithfulness to your wedding couple. Beginner sound system watching high decibel locations would be wise to always remember some sort of vital secret produced by presentation, which is your auto. finest man speeches funny 366415

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: