1 / 17

Fall 2006

Florida Atlantic University Department of Computer Science & Engineering. COP 4814 – Web Services Dr. Roy Levow Part 4 - XML. Fall 2006. XML support generally limited to IE and Firefox XML in IE Microsoft.XmlDom in IE4.0 MSXML ActiveX in IE 5.0+ But only on Windows; not on MAC

Download Presentation

Fall 2006

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Florida Atlantic UniversityDepartment of Computer Science & Engineering COP 4814 – Web Services Dr. Roy Levow Part 4 - XML Fall 2006

  2. XML support generally limited to IE and Firefox XML in IE Microsoft.XmlDom in IE4.0 MSXML ActiveX in IE 5.0+ But only on Windows; not on MAC Text uses createDocument() for cross-IE compatability XML DOM object created from string XML, XPath, XSLT

  3. DOM object properties childNodes, firstChild, lastChild, parentNode, nextSibling, previousSibling, nodeName, nodeType, nodeValue text, attributes xml ownerDocument – root node Navigate tree with these functions XML DOM Navigation

  4. Examples: IE DOM DOM creation Get Elements by Tag Name Create Node Insert Node Remove Child Replace Child IE XML DOM Navigation Examples

  5. Creates and propagates exception object parseError parseError object provides details errorCode, reason filePos, line, linePos srcText url IE XML DOM Error Handling

  6. Uses createDocument() method to generate DOM object Empty From string From url load() method loads from a url String version of XML subtree is produced by XMLSerializer object XML DOM in Firefox

  7. Error handling Firefox produces an error document Not the error object of IE It can be parsed to get the same information XML DOM in Firefox - 2

  8. Examples: Firefox DOM DOM Dreation DOM Parser Get text Serialize Error handling Firefox XML DOM - 3

  9. Requires library to create standard calls for operations Text provides zXml library zXmlDom.createDocument() Examples: Cross-Browser DOM Processing Book List Cross-Browser XML

  10. XML uses namespace concept to resolve naming conflicts between documents from different sources Tag name has form ns:tagName Declared as xmlsn:ns-prefix=“nsURI” URI has same syntax as URL but need not be real address Should be unique Declarations in root tag of document XML Namespaces

  11. XPath expressions Context node is partial path from which selection begins book/author – this parent-child sequence Selection pattern specifies which nodes to include book[@isbn=‘0010001001’] Expressions have own syntax and can be quite complex XPath

  12. IE uses two functions selectSingleNode() selectNodes() Examples: IE XPath Firefox uses two objects XPathEvaluator XPathResult Examples: Firefox XPath XPath in IE and Firefox

  13. Use zXml library Same functions as IE Examples: Cross-Browser XPath Cross-Browser XPath

  14. Transformation is done with xsl:stylesheet with XML specific elements xsl:template to select XMLnodes to process xsl:variable to select attributes from nodes Examples: XSLT XSL Transformations

  15. Browser becomes an issue when DOM is used in conjunction with XSLT Must create ActiveX XSLTemplate object Create processor object from template object transform() method does transformation Result is output property of processor Examples: XSLT in IE XSLT in IE

  16. Requires library Text provides this in zXml Syntax similar to Firefox Example: Best Picks Revisited Cross-Browser XSLT

  17. First load XML and XSL into DOM objects Create XSLTProcessor Import XSL stylesheet Transform XmlDOM document or fragment Examples: XSL in Firefox XSLT in Firefox

More Related