Multi Platform Applications XML, XPath, XSLT transform.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Dr. Alexandra I. Cristea CS 253: Topics in Database Systems: XPath, NameSpaces.
XML: Extensible Markup Language
Dr. Alexandra I. Cristea XPath and Namespaces.
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.
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.
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.
XSL Concepts Lecture 7. XML Display Options What can XSL Transformations do? generation of constant text suppression of content moving text (e.g., exchanging.
WML/HTML and XML Multiplatform Applications. Agenda XML – History and purpose What have HTML, WML and XML got to do with each other Why useful for multiplatform.
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)
XML Language Family Detailed Examples Most information contained in these slide comes from: These slides are intended.
Cornell CS 502 More XML XML schema, XPATH, XSLT CS 502 – Carl Lagoze – Cornell University.
XML –Query Languages, Extracting from Relational Databases ADVANCED DATABASES Khawaja Mohiuddin Assistant Professor Department of Computer Sciences Bahria.
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.
Manohar – Why XML is Required Problem: We want to save the data and retrieve it further or to transfer over the network. This.
Overview of XPath Author: Dan McCreary Date: October, 2008 Version: 0.2 with TEI Examples M D.
Introduction to XPath Bun Yue Professor, CS/CIS UHCL.
XSLT XSLT: eXtensible Stylesheet Language for Transformations - a language for transforming XML documents into any text- based format (e.g. HTML, plain.
CSE3201/CSE4500 XPath. 2 XPath A locator for elements or attributes in an XML document. XPath expression gives direction.
Lecture 6 of Advanced Databases XML Schema, Querying & Transformation Instructor: Mr.Ahmed Al Astal.
XML and XPath. Web Services: XML+XPath2 EXtensible Markup Language (XML) a W3C standard to complement HTML A markup language much like HTML origins: structured.
Xpath Xlink Xpointer Xquery Sources:
1/17 ITApplications XML Module Session 7: Introduction to XPath.
IS432 Semi-Structured Data Lecture 5: XSLT Dr. Gamal Al-Shorbagy.
Introduction to XPath Web Engineering, SS 2007 Tomáš Pitner.
CSE3201/CSE4500 Information Retrieval Systems
XPath XPath is used to navigate through elements and attributes in an XML document. XPath is a major element in W3C's XSLT standard - and XQuery and XPointer.
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
CSC 330 E-Commerce Teacher Ahmed Mumtaz Mustehsan Ahmed Mumtaz Mustehsan GM-IT CIIT Islamabad GM-IT CIIT Islamabad CIIT Virtual Campus, CIIT COMSATS Institute.
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.
Session II Chapter 2 – Chapter 2 – XSLhttp://
XPath Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Processing of structured documents Spring 2003, Part 7 Helena Ahonen-Myka.
1 XSLT An Introduction. 2 XSLT XSLT (extensible Stylesheet Language:Transformations) is a language primarily designed for transforming the structure of.
ECA 228 Internet/Intranet Design I XSLT Example. ECA 228 Internet/Intranet Design I 2 CSS Limitations cannot modify content cannot insert additional text.
Li Tak Sing COMPS311F. XPath XPath is a simple language that allows you to write expressions to refer to different parts of an XML document. We will learn.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
E0262 – MIS – Multimedia Storage Techniques XML (Extensible Markup Language  XML is a markup language for creating documents containing structured information.
Lecture 6: XML Query Languages Thursday, January 18, 2001.
XPath Presented by Kushan Athukorala. 2 Agenda XPath XPath Terminology Selecting Nodes Predicates.
1 XML Data Management Extracting Data from XML: XPath Werner Nutt based on slides by Sara Cohen, Jerusalem.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
Submitted To: Ms. Poonam Saini, Asst. Prof., NITTTR Submitted By: Rohit Handa ME (Modular) CSE 2011 Batch.
More XML XPATH, XSLT CS 431 – February 23, 2005 Carl Lagoze – Cornell University.
 XSL – Extensible Style Sheet Language  XSLT – XSL Transformations › Used to transform XML documents to other formats,like HTML or other XML documents.
Session II Chapter 3 – Chapter 3 – XPath Patterns & Expressions Chapter 4 – XPath Functions Chapter 15 – XPath 2.0http://
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 1 of 23 Objectives In this lesson, you will learn to: * Identify the types.
University of Nottingham School of Computer Science & Information Technology Introduction to XML 2. XSLT Tim Brailsford.
IS432 Semi-Structured Data Lecture 4: XPath Dr. Gamal Al-Shorbagy.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Linking XML Documents Ellen Pearlman Eileen Mullin Programming the Web.
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.
XSLT I Robin Burke ECT 360. Outline History / Terminology XSLT processing XSLT syntax XPath XSLT basics Lab.
1 XPath Extracting Data from XML. 2 Data stored in an XML document must be extracted to use with various applications Data can be extracted programmatically.
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.
XML Notes taken from w3schools. What is XML? XML stands for EXtensible Markup Language. XML was designed to store and transport data. XML was designed.
XML. What is XML? XML stands for EXtensible Markup Language XML is a markup language much like HTML XML was designed to carry data, not to display data.
XML Related Technologies
Querying and Transforming XML Data
XML stands for Extensible Markup Language.
XML Path Language Andy Clark 17 Apr 2002.
Document Object Model (DOM): Objects and Collections
Modified Slides from Dr. Sagiv
Modified Slides from Dr. Sagiv
More XML XML schema, XPATH, XSLT
Presentation transcript:

Multi Platform Applications XML, XPath, XSLT transform

This Week XPATH – way of breaking down XML docs XML-FO – a method to format docs XSLT – A simpler method of formatting docs

XPATH Used to break down the structure of a XML doc and reference sections The nodes of an XML document can be treated as parts of a document tree

Nodes of an XML doc document (root) nodes comment,processing-instruction,namespace,text,attribute,element,

XML nodes <message><mail><to>Patrick</to><from>Mick</from><heading>Meeting</heading> Don't forget we need to meet tonight Don't forget we need to meet tonight </mail></message> Node

XML relationships - children <message><mail><to>Patrick</to><from>Mick</from><heading>Meeting</heading> Don't forget we need to meet tonight Don't forget we need to meet tonight </mail></message> Children of the message object

XML relationships – parent and siblings <message><mail><to>Patrick</to><from>Mick</from><heading>Meeting</heading> Don't forget we need to meet tonight Don't forget we need to meet tonight </mail></message> Parent of the to,from, heading etc objects These four items are siblings (same parent)

XML relationships - ancestors <message><mail><to>Patrick</to><from>Mick</from><heading>Meeting</heading> Don't forget we need to meet tonight Don't forget we need to meet tonight </mail></message> Ancestors of the “to” object are the mail and message object

XML relationships - descendants <message><mail><to>Patrick</to><from>Mick</from><heading>Meeting</heading> Don't forget we need to meet tonight Don't forget we need to meet tonight </mail></message> Al these are descendants of the message object

XPath Methods of selecting nodes

Selecting Nodes ExpressionDescription nodename Selects all child nodes of the named node / Selects from the root node // Selects nodes in the document that matches the named node in the document. Selects the current node.. Selects the parent of the current Selects attributes

XPath addressing For example to – will highlight all items called to /message – will select all items under that element //body – will select all items in the document of that name

Expressions Path ExpressionResult /mail/subject[1]Selects the first subject element that is the child of the mail element /mail/subject[last()]Selects the last subject element that is the child of the mail element /mail/subject[last()-1]Selects the last but one subject element that is the child of the mail element /mail/subject[position()<3]Selects the first two subject elements that are children of the mail element /mail/subject[ID>5]Selects all the subject elements of the mail element that have a ID element with a value greater than /mail/subject[ID>5]/priorit y Selects all the title elements of the subject elements of the mail element that have an ID element with a value greater than 5

Wildcards * - Matches any element node * - Matches any element - Matches any attribute - Matches any attribute node node() -- Matches any node of any kind node() -- Matches any node of any kind

Further Reading Look into Xpath Axes and Xpath Location paths You can also see the operators available at functions /#op.numeric functions /#op.numeric functions /#op.numeric Or nctions.asp nctions.asp nctions.asp

XLink and Xpointer XLink - XML Linking Language XLink is a language for creating hyperlinks in XML documents XLink is similar to HTML links - but more powerful Not limited to images and text - any element in an XML document can behave as an XLink

Xlinks 2 XLink has two grouping of links simple links (like HTML) and extended links (for linking multiple resources) With XLink, the links can be defined externally to the linked resources XLink is a W3C Standard

XPointer XPointer - XML Pointer Language XPointer allows hyperlinking to specific parts of an XML document XPointer uses XPath expressions to navigate the position in an XML document XPointer is a W3C Standard

Simple Xlink Visit Bolton Visit Bolton BBC BBC </homepages>

Pointing with Paths Remember the CD catalog example How would we pick out an artist from that XML file? We can point not just to a file but to an area of a file e.g. href=" sc(‘Hits').child(1,item)"

XML <collection> Five Five UK UK Telstar Telstar </collection>

Xpointer and links xlink:href=" og.xml#xpointer(id(‘Hits'))" You can use a shorter version when linking to an element with an id tag. You can use the value of the id directly, like this: s"

Useful Links http-- sqlxml.pdf http-- sqlxml.pdf SQL Server 2000 and XML Part 6 - Annotated XDR Schemes Free Tutorial Beginners.co.uk SQL Server 2000 and XML Part 6 - Annotated XDR Schemes Free Tutorial Beginners.co.uk