Designing Streamable XPath Expressions Roger L. Costello January 5, 2014 1.

Slides:



Advertisements
Similar presentations
Introduction to XSL XSL-BASIC ELEMENTS. Transforming XML XSL file 1 XSLT Processor WML fileXSL file 2HTML fileXML file Contenuto Forma Documento.
Advertisements

Advanced XSLT II. Iteration in XSLT we sometimes wish to apply the same transform to a set of nodes we iterate through a node set the node set is defined.
Advanced XSLT. Branching in XSLT XSLT is functional programming –The program evaluates a function –The function transforms one structure into another.
Advanced XSLT II. Iteration in XSLT we sometimes wish to apply the same transform to a set of nodes we iterate through a node set the node set is defined.
Interval Heaps Complete binary tree. Each node (except possibly last one) has 2 elements. Last node has 1 or 2 elements. Let a and b be the elements in.
Internet Technologies1 1 Lecture 4: Programming with XSLT.
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
Transforming XML Part I Document Navigation with XPath John Arnett, MSc Standards Modeller Information and Statistics Division NHSScotland Tel:
XML Design for Streamability Roger L. Costello November 24,
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.
Multi Platform Applications XML, XPath, XSLT transform.
XSLT Stylesheets Some more advanced examples (adapted from the Edinburgh LT site)
1 XSL – XML Stylesheet Language. 2 XSL XSL = XML Stylesheet Language XSL cosists of –XPath (navigation in documents) –XSLT (T for transformations) –XSLFO.
Rendering XML documents with XSL The most powerful approaches to rendering XML documents involve using XSL (eXtensible Stylesheet Language) XSL enables.
1 Overview of XPath. 2 XPATH XPath expressions are used to locate nodes in XML documents The list of nodes located by an XPath expression is called a.
XSL Concepts Lecture 7. XML Display Options What can XSL Transformations do? generation of constant text suppression of content moving text (e.g., exchanging.
A note on generating text with the xsl:value-of instruction.
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)
1 Copyright (c) [2000]. Roger L. Costello. All Rights Reserved. Using XSLT and XPath to Transform XML Documents Roger L. Costello XML Technologies.
1 Copyright (c) [2000]. Roger L. Costello. All Rights Reserved. Using XSLT and XPath to Transform XML Documents into Text Files Roger L. Costello XML Technologies.
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.
XML Language Family Detailed Examples Most information contained in these slide comes from: These slides are intended.
1 XPATH Modified Slides from Dr. Sagiv. 2 XPath A Language for Locating Nodes in XML Documents XPath expressions are written in a syntax that resembles.
XML Primer. 2 History: SGML vs. HTML vs. XML SGML (1960) XML(1996) HTML(1990) XHTML(2000)
1 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. Using Extension Elements and Extension Functions with XSLT and XPath Roger L. Costello.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
AVL Trees / Slide 1 Deletion  To delete a key target, we find it at a leaf x, and remove it. * Two situations to worry about: (1) target is a key in some.
Internet Technologies1 XSLT Processing XML using XSLT Using XPath.
SD2520 Databases using XML and JQuery
Using XSLT and XPath to Enhance HTML Documents Reference: Roger L. Costello
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.
Recursive Descent Parsing for XML Developers Roger L. Costello 15 October
1/17 ITApplications XML Module Session 7: Introduction to XPath.
Introduction to XPath Web Engineering, SS 2007 Tomáš Pitner.
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
WORKING WITH XSLT AND XPATH
1 XPath XPath became a W3C Recommendation 16. November 1999 XPath is a language for finding information in an XML document XPath is used to navigate through.
Meet the Document Tree Your roadmap to Web Design.
XPath Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
XSLT part of XSL (Extensible Stylesheet Language) –includes also XPath and XSL Formatting Objects used to transform an XML document into: –another XML.
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
XSLT Introduction. XSLT is the transformation part of XSL An XSLT file contains rules which are applied against and XML file to produce an output Outputs.
August Chapter 6 - XPath & XPointer Learning XML by Erik T. Ray Slides were developed by Jack Davis College of Information Science and Technology.
XSLT Streaming Terminology Understanding “Climbing” Roger L. Costello January 29, 2014.
1 XML Data Management Extracting Data from XML: XPath Werner Nutt based on slides by Sara Cohen, Jerusalem.
1 Copyright (c) [2000]. Roger L. Costello. All Rights Reserved. Using XSLT and XPath to Transform XML Documents Roger L. Costello XML Technologies.
XPath. XPath, the XML Path Language, is a query language for selecting nodes from an XML document. The XPath language is based on a tree representation.
University of Nottingham School of Computer Science & Information Technology Introduction to XML 2. XSLT Tim Brailsford.
Digital Media Technology Week 7: XSLT 3. Characteristics of digital models □ “a set of ontological commitments” □ Expressed in a “formal language”
CSE3201/CSE4500 XPath. 2 XPath A locator for items in XML document. XPath expression gives direction of navigation.
XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman.
1 XPath. 2 Agenda XPath Introduction XPath Nodes XPath Syntax XPath Operators XPath Q&A.
1 Whitespace Handling Roger L. Costello XML Technologies.
1 The XPath Language. 2 XPath Expressions Flexible notation for navigating around trees A basic technology that is widely used uniqueness and scope in.
© 2013 The MITRE Corporation. All rights reserved. XSLT Streaming Terminology Understanding “Climbing” Roger L. Costello, February 3, 2014.
CITA 330 Section 5 XPath. XSL XSL (Extensible Stylesheet Language) is the standard language for writing stylesheets to transform XML documents among different.
1 XSL Transformations (XSLT). 2 XSLT XSLT is a language for transforming XML documents into XHTML documents or to other XML documents. XSLT uses XPath.
Querying and Transforming XML Data
Using XSLT and XPath to Transform XML Documents
{ XML Technologies } BY: DR. M’HAMED MATAOUI
Querying XML XQuery.
Querying XML XQuery.
XML Path Language Andy Clark 17 Apr 2002.
Querying XML XPath.
Querying XML XPath.
Querying XML XSLT.
XPath 9-May-19.
XPath 7-Dec-19.
Presentation transcript:

Designing Streamable XPath Expressions Roger L. Costello January 5,

Acknowledgement The example shown in the following slides comes from the XSLT 3.0 specification. 2

Count the elements Suppose an XML document contains a bunch of elements. Every element has a child element. You are to create an XPath expression to count the elements that are within the elements. A element may contain a child element (in addition to its child element). Here is a sample XML document: … … 3 You are to design the XPath so that it can be used in a streaming program: you are to design a streamable XPath expression! count(xpath) should return 2.

Not a streamable XPath expression This XPath is not streamable: count(//section/head) Let’s see why. Consider our sample XML document: 4 … … This is the first section element that is fetched. Its head element is down here To fetch the second section element the XSLT processor would have to back up, which is not allowed in streaming. Therefore, this XPath expression is not streamable: //section/head

Streamable XPath expression A rule of streaming is that you can always access ancestors. So, to make the XPath expression viable for streaming, find each element that has a parent element: count(/descendant::head[parent::section]) 5 … … This is the first head element that is fetched. It has a parent section element. Therefore, this XPath expression is streamable: /descendant::head[parent::section]

Issues in streaming A streaming processor always moves forward, it can never back up. So if your program contains an XPath expression which would require the processor to back up, your program is not streamable. As a streaming processor descends the input document’s XML tree, it keeps a record of nodes it has visited. Thus, your program can reference ancestors. 6