Question

Discuss the different XML-related technologies such as DOM, XMLReader, XMLWriter, XPath, XSL, and XSLT. What are...

Discuss the different XML-related technologies such as DOM, XMLReader, XMLWriter, XPath, XSL, and XSLT. What are the advantages and disadvantages of each and when should each be used?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The following section-wise solution contains an overview about each term followed by their usability comparison and guidelines for usage.

DOM

DOM stands for Document Object Model. It is a programming interface for HTML and XML related documents which decides the way documents can be modified and accessed.Using this, the developer can create documents, walk through its structure, and add, modify, or delete the elements of the document. Anything found in an HTML/XML document can be accessed, changed, deleted, or added using DOM.

It the logical model for the programming interface which may be implemented in any way that a particular implementation finds convenient but it is important to note that DOM does not specify the implementation details.

An important aim for DOM is to provide a standard programming interface to be used in a wide variety of environments and applications to enable cross-functional use along with standardization.

XMLReader

XMLReader provides quick, non-cached, forward-only access to the XML data. Its methods allow the user to move through XML based data and read the contents of the nodes. The properties of this XMLReader class reflect the value of the current node, where the reader is positioned.

It reduces the memory space required for the parser and is efficient.

XmlReader introduces more complexity into code parsing in the program because it is a forward-only parser.

XMLWriter

XMLWriter provides a fast, non-cached, forward-only way to produce streams/files containing XML data. The members of the XmlWriter class enable you to verify whether the characters are valid XML data and whether the document is well-formed. It encodes binary bytes as Base64 or BinHex and also can write multiple documents to a single output stream.

The class has exclusive control over its internal fields and is properly encapsulated.

XMLWriter often gives InvalidOperationException which can be solved by giving the root element into your document. Also, XMLWriter getter functions complicate the code slightly but make the document much safer, which is a tradeoff of using this.

XSL and XSLT

XSL stands for extensible stylesheet language and is similar to CSS which is used with HTML. In case of XML documents, tags are not predefined, therefore, to understand and style XML documents, W3C developed XSL to act as an XML-based Stylesheet Language. XSL documents specify how a browser should render XML documents. Similarly, XSLT (Extensible Stylesheet Language Transformations) is a language for transforming these XML documents into other formats such as HTML, plain text or XSL Formatting Objects.

XSL provides clean and uncomplicated templated and is a reasonably fast and easy way to process XML data into HTML.

However, this programming standard is uncomfortable for new developers coming and can be slow when not used carefully and if programmed unoptimally.

XPath

It is a query language used to traverse through an XML document. It is used commonly to search particular elements or attributes with matching patterns. Xpath defines a language to find information in an XML file which is subsequently used to traverse elements and attributes of XML docs. XPath provides various types of expressions which can be used to query relevant info from XML docs.

It is important to note that XPath is core component of the XSLT standard and XSLT cannot work without XPath.

XPath is convenient for using with relative paths rather than absolute paths. Additionaly, it is not supported by some browsers so must be avoided if the application is aimed for multiple browsers especially mobile-based browsers.

Add a comment
Know the answer?
Add Answer to:
Discuss the different XML-related technologies such as DOM, XMLReader, XMLWriter, XPath, XSL, and XSLT. What are...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT