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?
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.
Discuss the different XML-related technologies such as DOM, XMLReader, XMLWriter, XPath, XSL, and XSLT. What are...
Discuss the similarities and differences between DTD and XML schema; XSLT and Xpath
POST ONE ORIGINAL QUESTION about any of the following subjects: Writing XML, XSLT, XPath Patterns and also Expressions, XPath Functions, as well as XSL-FO.
1.What is well-formedness and validity in the context of XML? How do they differ? 2. What is XSLT? How can it be used in web development? 3. Using the XML document shown in Figure 17.5, what would be the XPath expressions for selecting artists from France? For selecting paintings whose artists are from France? 4. What are the in-memory and the event approaches to XML processing? How do they differ? What are some examples of each approach in PHP? 5....
1. Discuss the difference between inheritance and composition. What are the advantages and disadvantages of each? Can you implement one with the other? 2.How is a class similar to a database table? How is it different? How do these similarities and differences justify the need for class models and for data models? Or do they? 3.Discuss the difference between association and composition. What are the advantages and disadvantages of each? 4.When would you apply inheritance? When would you not? Provide...
1) In the XPath data model, a root node represents _______________? a) the document itself b) all within the XML declaration c) all the information within a particular namespace d) the root element 2) What is not a valid XPath data model node? a) Element b) Root c) Attribute d) Text e) Document type declaration 3) which of the following lines is the abbreviated syntax of attribute::attributename? a) %Cattributame b) &attributename c) @attributename d) #attributename 4) Axes are used to...
1. Discuss the difference between inheritance and composition. What are the advantages and disadvantages of each? Can you implement one with the other? 2.How is a class similar to a database table? How is it different? How do these similarities and differences justify the need for class models and for data models? Or do they? 3.Discuss the difference between association and composition. What are the advantages and disadvantages of each? 4.When would you apply inheritance? When would you not? Provide...
Identify and discuss the importance of different technologies used in operational database systems and in decision support database systems.
Discuss the different means that physicians have to communicate with patients electronically today. Discuss the advantages and disadvantages. Discuss the gap between what the patient wants and what the physician is willing or able to provide.
Briefly discuss an advantage of being taxed as an S-Corporation. Explain what is different from the way it would be handled if the taxpayer was a partnership or a C-Corporation. Discuss a disadvantage of being taxed as an S-Corporation. Discuss whether the advantages can outweigh the disadvantages.
What are the three types of motion and how are they used to generate useful powers? What are their advantages and disadvantages? What bio-related technologies did humans use in past? What bio-related technologies did humans use today? Please describe five methods used in treatment of diseases.