Lecture 12. Default Processing in XSLT The default processing in XSLT is to process the XPath root node The default processing for various node types.

Slides:



Advertisements
Similar presentations
Internet Technologies1 1 Lecture 4: Programming with XSLT.
Advertisements

UFCE8V-20-3 Information Systems Development 3 (SHAPE HK) Lecture 12 Extensible Stylesheet Language Transformations : XSLT.
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
Managing Data Exchange: XPath
XPath XML Path Language. Outline XML Path Language (XPath) Data Model Description Node values XPath expressions Relative expressions Simple subset of.
Transforming XML Part I Document Navigation with XPath John Arnett, MSc Standards Modeller Information and Statistics Division NHSScotland Tel:
XML Name spaces. Different people may invent similar tag names Here is an XML element describing a piece of furniture: table99 dining table Here.
XPath. XPath Used to access part of XML document Used to access part of XML document Compact, non-XML syntax Compact, non-XML syntax Use a pattern expression.
The learning site: /xpath_syntax.asp xsl/xsl/slides.html.
XPath Eugenia Fernandez IUPUI. XML Path Language (XPath) a data model for representing an XML document as an abstract node tree a mechanism for addressing.
SDPL 2002Notes 5: XSLT1 5. Document Transformations n XSLT (W3C Rec. November 1999) –A language for transforming XML documents »representative of tree-based.
XML 6.6 XPath 6. What is XPath? XPath is a syntax used for selecting parts of an XML document The way XPath describes paths to elements is similar to.
SDPL 2003Notes 5: XSLT1 5. Document Transformations n XSLT (W3C Rec. November 1999) –A language for transforming XML documents »representative of tree-based.
2-Jun-15 XPath. 2 What is XPath? XPath is a syntax used for selecting parts of an XML document The way XPath describes paths to elements is similar to.
XSLT Stylesheets Some more advanced examples (adapted from the Edinburgh LT site)
Lecture 10. Back to the table example We can now return to considering in detail the first XSLT style-sheet we saw –The one which, when applied to the.
Lecture 13. The various node tests also work on this axis: eg node() This book has descendant-or- self nodes As expected, text nodes are included in the.
Lecture 13. The various node tests also work on this axis: eg node() This book has descendant-or- self nodes As expected, text nodes are included in the.
Rendering XML documents with XSL The most powerful approaches to rendering XML documents involve using XSL (eXtensible Stylesheet Language) XSL enables.
XPath s/xmljava/chapters/ch16.html.
XSL Concepts Lecture 7. XML Display Options What can XSL Transformations do? generation of constant text suppression of content moving text (e.g., exchanging.
XSL Transformations Lecture 8, 07/08/02. Templates The whole element is a template The match pattern determines where this template applies Result element(s)
Lecture 11. The delivery of this lecture was recorded. You may wish to listen to the recording as you read these slides The recording is here:
Managing XML and Semistructured Data Lecture 6: XPath Prof. Dan Suciu Spring 2001.
XPath Carissa Mills Jill Kerschbaum. What is XPath? n A language designed to be used by both XSL Transformations (XSLT) and XPointer. n Provides common.
XML Language Family Detailed Examples Most information contained in these slide comes from: These slides are intended.
XPath Tao Wan March 04, What is XPath? n A language designed to be used by XSL Transformations (XSLT), Xlink, Xpointer and XML Query. n Primary.
CS 4408 Lecture 9. XSLT instruction elements We have seen that a template can contain non-XSLT text, canned text that it inserts into the result tree.
Lecture 14. node-tests again: namespace-qualified node-tests I found a book. The fred:* node test admits only element in the fred namespace The match="book"
Object Oriented Programming III1 XSLT Processing XML using XSLT Using XPath.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
Internet Technologies1 XSLT Processing XML using XSLT Using XPath.
Introduction to XPath Bun Yue Professor, CS/CIS UHCL.
SD2520 Databases using XML and JQuery
Navigating XML. Overview  Xpath is a non-xml syntax to be used with XSLT and Xpointer. Its purpose according to the W3.org is  to address parts of an.
CSE3201/CSE4500 XPath. 2 XPath A locator for elements or attributes in an XML document. XPath expression gives direction.
TDDD43 XML and RDF Slides based on slides by Lena Strömbäck and Fang Wei-Kleiner 1.
SDPL 20075: Overview of XSLT1 5 Document Transformations n XSLT (1.0 W3C Rec. 11/1999; XSLT 2.0 Rec. 1/07) –A language for transforming XML documents –initial.
1/17 ITApplications XML Module Session 7: Introduction to XPath.
Introduction to XPath Web Engineering, SS 2007 Tomáš Pitner.
CSE3201/CSE4500 Information Retrieval Systems
XSLT and XPath, by Dr. Khalil1 XSL, XSLT and XPath Dr. Awad Khalil Computer Science Department AUC.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
XPath Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Processing of structured documents Spring 2003, Part 7 Helena Ahonen-Myka.
XPath. Why XPath? Common syntax, semantics for [XSLT] [XPointer][XSLT] [XPointer] Used to address parts of an XML document Provides basic facilities for.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
XSLT I Robin Burke ECT 360. Outline XSLT processing XSLT syntax XPath XSLT basics Lab.
XSLT part of XSL (Extensible Stylesheet Language) –includes also XPath and XSL Formatting Objects used to transform an XML document into: –another XML.
Lecture 11 XSL Transformations (part 1: Introduction)
IS432: Semi-Structured Data Dr. Azeddine Chikh. 6. XML Path (XPath)
August Chapter 6 - XPath & XPointer Learning XML by Erik T. Ray Slides were developed by Jack Davis College of Information Science and Technology.
Lecture 6: XML Query Languages Thursday, January 18, 2001.
Database Systems Part VII: XML Querying Software School of Hunan University
XPath Aug ’10 – Dec ‘10. XPath   XML Path Language   Technology that allows to select a part or parts of an XML document to process   XPath was.
SDPL 2001Notes 5: XSLT1 5. Document Transformations n XSLT (W3C Rec. Nov-99) –A language for transforming XML documents »representative of features common.
CSE 636 Data Integration Fall 2006 XML Query Languages XPath.
WPI, MOHAMED ELTABAKH PROCESSING AND QUERYING XML 1.
1 XML Data Management Extracting Data from XML: XPath Werner Nutt based on slides by Sara Cohen, Jerusalem.
1 XML Data Management XPath Principles Werner Nutt.
More XML XPATH, XSLT CS 431 – February 23, 2005 Carl Lagoze – Cornell University.
University of Nottingham School of Computer Science & Information Technology Introduction to XML 2. XSLT Tim Brailsford.
CSE3201/CSE4500 XPath. 2 XPath A locator for items in XML document. XPath expression gives direction of navigation.
XPath --XML Path Language Motivation of XPath Data Model and Data Types Node Types Location Steps Functions XPath 2.0 Additional Functionality and its.
Designing Streamable XPath Expressions Roger L. Costello January 5,
XSLT I Robin Burke ECT 360. Outline History / Terminology XSLT processing XSLT syntax XPath XSLT basics Lab.
1 The XPath Language. 2 XPath Expressions Flexible notation for navigating around trees A basic technology that is widely used uniqueness and scope in.
5 Copyright © 2004, Oracle. All rights reserved. Navigating XML Documents by Using XPath.
XML Query languages--XPath. Objectives Understand XPath, and be able to use XPath expressions to find fragments of an XML document Understand tree patterns,
XML Path Language Andy Clark 17 Apr 2002.
Presentation transcript:

Lecture 12

Default Processing in XSLT The default processing in XSLT is to process the XPath root node The default processing for various node types is –Root node: Apply templates to children –Element nodes: Apply templates to children –Text nodes: Copy text to the result tree –Comment nodes: Do nothing –PI nodes: Do nothing –Attribute nodes: Copy the value of the attribute to the result tree –Namespace nodes: Do nothing

Default processing example The following is the simplest possible XSLT stylesheet </xsl:transform It contains no templates so default processing is used –the string-value of the text nodes is output –remember:attribute nodes are not regarded as children of an element node –that's why the values of the attributes is not printed above

Overriding default processing (contd.) Default processing is overridden –the template for the root node specifies that nothing should be output –its children nodes are not processed

XPath axes (contd.) At the end of the last lecture, we looked as the child axis We will now look at the full set of axes

Axis Specifiers A XPath node has thirteen axes: –ancestor Ancestors of the current node –ancestor-or-self Ancestors, including the current node –attribute Attributes of the current node (abbreviated –child Children of the current node (the default axis) (never contains namespace nodes) –descendant Descendants of the current node (thus, never contains attribute or namespace nodes) –descendant-or-self Descendants, including the current node (abbreviated "//")

Axis Specifiers (contd.) –following / following-sibling Nodes which occur after the current node, in document order –preceding / preceding-sibling Nodes which occur before the current node, in document order (returned in reverse-document order) –namespace The namespace nodes of the current node. An element has a namespace node –for every attribute on the element whose name starts with xmlns: ; –for every attribute on an ancestor element whose name starts xmlns: unless the element itself or a nearer ancestor redeclares the prefix; –for an xmlns attribute, if the element or some ancestor has an xmlns attribute, and the value of the xmlns attribute for the nearest such element is non-empty –parent The parent of the current node (abbreviated "..") –self The current node (abbreviated ".")

A reminder: the child axis The catalogue node has child nodes.

the descendant axis The catalogue node has descendant nodes. Note that only element descendant nodes are counted This is because the node test * matches only nodes of the current principal type -- which is element nodes in this case

A different node test The catalogue node has descendant nodes. Text nodes are now being counted The node test node() is true for any sort of node The attribute nodes are still not counted because they are not regarded as children or descendants

Yet another node test The catalogue node has descendant text nodes. The node test text() is true only for text nodes

A different XML document: testing for comment nodes The catalogue node has descendant comment nodes. The node test comment() is true only for text nodes

Using tag-names as node tests The catalogue node has descendant text nodes. The node test price is true only for nodes corresponding to price elements

To prepare for other axes: a slightly different usage This book has descendant nodes

the descendant-or-self axis This book has descendant-or-self nodes As expected, the node counts this time exceed, by 1, those reported on previous slide