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

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSI 3540 Structures, techniques et normes du Web Friday, March 19, 2010 Objectifs : Matriser le langage XML 1.0 Savoir utiliser les outils standard pour le traitement de XML Lectures : Web Technologies (2007) 7 Pages 402418 Reprsentation des donnes du Web en XML Friday, March 19, 2010 Plan 1. Transformations 1. XPath 2. XSL 3. XSLT Friday, March 19, 2010 Transformations XSL (XSLT) Document XML Processeur XSLT Transformation XSL Document XML Friday, March 19, 2010 XSL signife Extensible Stylesheet Language XSL est un vocabulaire XML XSL cest trois recommandations : XSLT (vocabulaire XSL ) XPath (adressage des noeuds) XSL-FO ( Formatting objects , styles) Friday, March 19, 2010 XSL Transformations : XML, XML, XML La source est une application XML Le rsultat est une application XML La transformation est une application XML Do limportance des espaces de nommage ! Friday, March 19, 2010 Une transformation XSL est appele feuille de style Une feuille de style contient un ensemble de rgles modles Une rgle modle se compose dun Fltre (a.k.a. motif , pattern ) et un modle Le Fltre sert identiFer des noeuds de larbre-source Le modle est instanti aFn de produire une partie de larbre-rsultat Friday, March 19, 2010 Un modle contient des litraux (lments de lapplication rsultat, par exemple) des instructions XSL (noncs de contrle) Friday, March 19, 2010 XSLT <? xml version = "1.0" encoding = "UTF-8" ?> <xsl:transform version = "1.0" xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" xmlns = "http://www.w3.org/1999/xhtml" > <xsl:template match = pattern > contenu </xsl:template> ... <xsl:template match = pattern > contenu </xsl:template> ... <xsl:template name = nom > contenu </xsl:template> </xsl:transform> Rgles modle version est obligatoire Convention :- prfixe xsl pour le vocabulaire XSLT- espace de nommage par dfault pour le vocabulaire destination Une rgle de transformation est forme dun ou plusieurs patrons. Llment template possde un attribut match Friday, March 19, 2010 <xsl:template match="/catalog"> <html> <head> <title>Liste des albums</title> </head> <body> <ul> <xsl:apply-templates select="album/name"/> </ul> </body> </html> </xsl:template> <xsl:template match="name"> <li> <xsl:value-of select="."/> </li> </xsl:template> Friday, March 19, 2010 XSL </xsl:transform> et </xsl:stylesheet> sont smantiquement quivalent (synonymes) Friday, March 19, 2010 XHTML en sortie <? xml version = "1.0" encoding = "UTF-8" ?> < xsl:transform version = "1.0" xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" xmlns = "http://www.w3.org/1999/xhtml" > < xsl:output indent = "yes" method = "xhtml" encoding = "UTF-8" omit-xml-declaration = "yes" doctype-public = "-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" /> ......
View Full 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 / 93

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

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

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