17_XML - CSI 3540 Structures, techniques et normes du Web...

Info iconThis preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon
CSI 3540 Structures, techniques et normes du Web Friday, March 19, 2010
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Objectifs : Maîtriser le langage XML 1.0 Savoir utiliser les outils standard pour le traitement de XML Lectures : Web Technologies (2007) § 7 Pages 402–418 Représentation des données du Web en XML Friday, March 19, 2010
Background image of page 2
Plan 1. Transformations 1. XPath 2. XSL 3. XSLT Friday, March 19, 2010
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
XPath La présentation couvre XPath 1.0 qui est la version du manuel du cours version supportée par Java 1.5 et 1.6 http://www.w3.org/TR/xpath XPath 2.0 est une recommandation datée du 23 janvier 2007 Friday, March 19, 2010
Background image of page 4
XPath XPath 2.0 est un surensemble de XPath 1.0 qui offre des fonctionnalités accrues, notamment pour les types (XML Schema) Michael Kay (2004) XPath 2.0 Programmer's Reference . Wrox, 552 pages. Friday, March 19, 2010
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
<? xml version = "1.0" encoding = "UTF-8" ?> < catalog > < album > < name >OK Computer</ name > < track > < name >Karma Police</ name > < artist >Radiohead</ > < genre >Alternative</ > </ > < > < name >Exit Music (For A Film)</ name > < > < > </ > </ > < > < name >Dark Side Of The Moon</ name > < > < name >Us And Them</ name > < >Pink Floyd</ > < >Progressive</ > </ > < > < name >Brain Damage</ name > < >Pink Floyd</ > < > </ > </ > ... ... < > < name >Requiem</ name > < > < name >Kyrie</ name > < >Wiener Philharmoniker - Herbert von Karajan</ > < composer >Wolfgang Amadeus Mozart</ > < >Classical</ > </ > </ > < > < name >African Guitar Summit</ name > < > < name >Obaa Y Ewa</ name > < >Pa Joe</artist> < >World</ > </ > < > < name >Mwajuma</ name > < >Adam Solomon</ > < >World</ > </ > </ > </ > Un document XML Friday, March 19, 2010
Background image of page 6
/child::catalog/child::album/child::name sélectionne 4 noeuds /descendant::name sélectionne 11 noeuds //child::track/child::composer sélectionne 1 noeud //child::track[child::artist='Radiohead'] sélectionne 2 noeuds //child::track[attribute::id="3"]/following-sibling::track sélectionne 1 noeud //self::name/child::text() sélectionne 11 noeuds XPath Friday, March 19, 2010
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Friday, March 19, 2010
Background image of page 8
widgets.xml <? xml version = '1.0' encoding = 'UTF-8' ?> < widgets > < widget > < manufacturer name = “Acme” /> < dimensions width = “1.0” height = “2 .0” /> </ > < > < = “K-Tel” /> < = “1.5” = /> </ > </ > Friday, March 19, 2010
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
javax.xml.xpath Depuis la version 1.5, Java supporte XPath (version 1.0) Friday, March 19, 2010
Background image of page 10
import javax.xml.xpath. * ; org.xml.sax. InputSource ; org.w3c.dom. NodeList ; Document ; ... XPath xpath = XPathFactory.newInstance().newXPath(); String expression = "/child::widge ts/child::widge t" ; QName returnType = XPathConstants.NODESET; inputSource = new ( "widgets.xml" ); nodes; node = ( ) xpath.evaluate( expression, inputSource, returnType ) ; Friday, March 19, 2010
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
XPath Conçu afin d’être le langage commun pour l’ adressage des parties (éléments, attributs, texte, etc.) d’un document XML L’adressage est définit par rapport à l’arbre d’analyse du document Au contraire du DOM, les attributs sont des noeuds de l’arbre La racine est un noeud supplémentaire qui désigne l’élément racine du document Friday, March 19, 2010
Background image of page 12
XPath XPath supporte les espaces de nommage , ainsi, le nom d’un noeud est un couple composé d’un espace de noms et d’un nom local ; URI désignant l’espace de nommage peut avoir la valeur null Friday, March 19, 2010
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
XPath : contexte Conçu afin d’être le langage commun aux applications devant manipuler des documents XML : XSLT ,
Background image of page 14
Image of page 15
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/07/2010 for the course CSI ITI1520 taught by Professor Marcelturcotte during the Spring '10 term at University of Ottawa.

Page1 / 49

17_XML - CSI 3540 Structures, techniques et normes du Web...

This preview shows document pages 1 - 15. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online