Upload
olympe-tessier
View
105
Download
0
Embed Size (px)
Citation preview
LexiqueLexique
Langages & Documents RéfsRéfs
TechsTechs
SommaireSommaire
..
..
..
..
.
..
Paul FranchiSI 5
2013-14
Chap III - XML Présentation ("Basic")
Chap VIII - XML Processeurs "Advanced"
http://www.polytech.unice.fr/~pfz/LANGDOC/COURS10 chapitres en 2 versions .ppt et .pdfaccès distant mais sans les exemples
ouaprès téléchargement du répertoire COURS
accès local avec les exemples
http://www.polytech.unice.fr/~pfz/LANGDOC/COURS10 chapitres en 2 versions .ppt et .pdfaccès distant mais sans les exemples
ouaprès téléchargement du répertoire COURS
accès local avec les exemples
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
..
..
..
..
.
..
Transparent 211/04/23
Sommaire du Cours
Chap I - Documents: Historique, Modèles, Standards et Références
Chap II - HTML: voir le cours CIP1-CMD & HTML5
Chap III - XML: "eXtensible Markup Language", les Bases
Chap IV - DTD: "Document Type Definition"
Chap V - CSS: Feuilles de Styles en Cascades& CSS3
Chap VI - DOM, DHTML: "Domain Object Model "& Programmation
Dynamique en HTML & SPRY & JQuery
Chap VII - XSD: Schémas XML
Chap VIII - XML "Advanced" Processeurs et Dialectes: XPath, Xlink
Chap IX - XSLT: Transformations XML
Chap X - RDF: "Resource Description Framework"
Chap IX - AJAX: "Asynchronous JavaScript And XML"
Savoir-Faire: Basic Advanced State of the Art
Etat de l'Art: HTML5 CSS3 SPRY JQuery SVG MathML RDF AJAX
SommaireSommaire
LexiqueLexique
Browsercompatibility
RéfsRéfs
TechsTechs
Transparent 311/04/23
Web EPU courses (in French)
Création & Manipulltion de Document http://www.polytech.unice.fr/~pfz/cmd.html
Introduction to Internet http://rainbow.i3s.unice.fr/iai/ Langages & Documents
http:www.polytech.unice;fr/~pfz/document.html
W3C tutorial : http://www.w3schools.com/ Mozilla Development Center
http://developer.mozilla.org/en/docs/Main_Page W3C, http://www.w3.org/ Web Developer's Bookmarks http://antriksh.com/resources/ XML Wiki Book
http://en.wikibooks.org/wiki/XML_-_Managing_Data_Exchange
Biblio: many issues at EPU's lib
Some References
SommaireSommaire
LexiqueLexique
Browsercompatibility
RéfsRéfs
TechsTechs
Transparent 411/04/23
Documentation et Manuels
Documents du web liste de balises HTML
code des couleurs RVB
code HTML des caractères ISO
liste des extensions de fichiers (formats)
Expressions Rationnelles
Manuels. Expressions régulières sous Emacs
Recherche et remplacement sous Emacs
compléments Emacs
grep sous Unix
SommaireSommaire
LexiqueLexique
Browsercompatibility
RéfsRéfs
TechsTechs
Transparent 511/04/23
Web Reference Browser
de XML vers HTML5+CSS3
metadata .xml metadata .xml
SommaireSommaire
LexiqueLexique
Browsercompatibility
RéfsRéfs
TechsTechs
Transparent 611/04/23
Doc Example Browser
de XML vers HTML5+CSS3+JS
metadata .xml metadata .xml
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
..
..
..
..
.
..
Transparent 711/04/23
API – Application Programming Interface ANSI – American National Standards Institute ASCII – American Standard Code for Information Interchange (128 car.) AJAX – Asynchronous JavaScript & XML CSS – Cascading Style Sheets DHTML – Dynamic HTML DOM – Document Object Model DTD – Document Type Definition HTML – HyperText Markup Language HTTP – HyperText Transfer Protocol ISO - International Standards Organization Mozilla - Fondation (global community for free and open Internet software)) MVC - Model View Controler RDF - Resource Description Framework REST - Representational State Transfer RIA - Rich Internet Application RSS - Really Simple Syndication SGML - Standard Generalized Markup Language SOAP - Simple Access Object Protocol SPRY - Extensions JS pour HTML - Adobe Lab. SVG - Scalable Vector Graphics UNICODE – World wide Code (16 bits) UTF-8 – Unicode version 8 bits URL / URI – Uniform Resource Locator / Identifier XML – eXtensible Markup Language XBL – XML Binding Language (Mozilla) XForms – XML Forms XHTML – HTML 4 en XML XLink – XML Linking Language XPath – XML Path Language XPointer – XML Pointer Language XSL - eXtensible Stylesheet Language XSLT – XSL Transformations XSL-FO – XSL Formatting Objects XSD – XML Schémas Définition Language XUL – XML User Language (Mozilla) W3C – World Wide Web Consortium Web2.0 – Web dit "sémantique" WHATWG - Web Hypertext Application Technology Working Group WSDL - Web Service Description Language
Lexique
LexiqueLexique
Langages & Documents RéfsRéfs
TechsTechs
SommaireSommaire
..
..
..
..
.
..
Paul FranchiSI 5
2013-14
Chap III - XML Présentation ("Basic")
Génèse de XMLMetaLangage
Norme LexicaleNorme SyntaxiqueEspaces de noms - NamespacesDialectes :
XHTML, MathML, SVG, etc
Techniques XML
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 911/04/23
XML - La Génèse et les Recommandations (W3C)
XML should be compatible with SGML XML should be easy to use in the Internet The number of optional characteristics should
be minimized XML-documents should be easy to generate
and human-readable XML should be supported by a variety of
application It should be easy to write programs for XML XML should be put into practice on time
XML should be compatible with SGML XML should be easy to use in the Internet The number of optional characteristics should
be minimized XML-documents should be easy to generate
and human-readable XML should be supported by a variety of
application It should be easy to write programs for XML XML should be put into practice on time
HTMLInformation presentationFixed set of tagsData presentation languageLimited hypertext linking
HTMLInformation presentationFixed set of tagsData presentation languageLimited hypertext linking
In 1996 a team under the guidance of Jos Bosak attending the W3C-consortium was established to make SGML web-suitable. The result was a 30-page specification, which received in February 1998 the status of a "W3C-recommendation" and was named "Extensible Markup Language (XML)".
In 1996 a team under the guidance of Jos Bosak attending the W3C-consortium was established to make SGML web-suitable. The result was a 30-page specification, which received in February 1998 the status of a "W3C-recommendation" and was named "Extensible Markup Language (XML)".
XML Information content Extensible set of tags Data exchange language Greater hypertext linking
XML Information content Extensible set of tags Data exchange language Greater hypertext linking
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 1011/04/23
XML - Applications Publication: Database content can be converted into XML
and afterwards into HTML by using an XSLT stylesheet. Making use of this technique, complex websites as well as print media like PDF files can be generated. Information no longer has to be stored in different formats (i.e. RTF, DOC, PDF, HTML). Content can be stored in the neutral XML format and then, using appropriate layout style sheets and transformations, brochures, websites, or datalists can be generated (see more in Chapter 17.)
Interaction: XML can be used for accessing and changing data interactively. This man<->machine communication usually happens via a web browser (see Chapter 12) .
Integration: Using XML, homogenous and heterogenous applications can be integrated. In this case, XML is used to describe data, interfaces, and protocols. This machine-machine communication helps integrate relational databases (i.e. by importing and exporting different formats).
Transaction: XML helps to process transactions in applications like online marketplaces, supply chain management, and e-procurement systems.
Publication: Database content can be converted into XML and afterwards into HTML by using an XSLT stylesheet. Making use of this technique, complex websites as well as print media like PDF files can be generated. Information no longer has to be stored in different formats (i.e. RTF, DOC, PDF, HTML). Content can be stored in the neutral XML format and then, using appropriate layout style sheets and transformations, brochures, websites, or datalists can be generated (see more in Chapter 17.)
Interaction: XML can be used for accessing and changing data interactively. This man<->machine communication usually happens via a web browser (see Chapter 12) .
Integration: Using XML, homogenous and heterogenous applications can be integrated. In this case, XML is used to describe data, interfaces, and protocols. This machine-machine communication helps integrate relational databases (i.e. by importing and exporting different formats).
Transaction: XML helps to process transactions in applications like online marketplaces, supply chain management, and e-procurement systems.
http://www.emimusic.de: This website contains approximately 20,000 pages with profiles of the artists, their products and the titles of the songs. These pages are generated using a XSLT script. ( catalog in PDF format.)
http://www.emimusic.de: This website contains approximately 20,000 pages with profiles of the artists, their products and the titles of the songs. These pages are generated using a XSLT script. ( catalog in PDF format.)
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 1111/04/23
10 reasons to use XML
XML is a widely accepted open standard.
XML allows to clearly separate content from form (appearance).
XML is text-oriented.
XML is extensible.
XML is self-describing.
XML is universal; meaning internationalization is no problem.
XML is independent from platforms and programming
languages.
XML provides a robust and durable format for information
storage.
XML is easily transformable.
XML is a future-oriented technology.
XML is a widely accepted open standard.
XML allows to clearly separate content from form (appearance).
XML is text-oriented.
XML is extensible.
XML is self-describing.
XML is universal; meaning internationalization is no problem.
XML is independent from platforms and programming
languages.
XML provides a robust and durable format for information
storage.
XML is easily transformable.
XML is a future-oriented technology.
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 1211/04/23
XML - eXtensible Marked up Langage
XML est une recommandation W3C (1998) pour le transport et le stockage de données
XML est un métalangage (ou méta-modèle) les balises ne sont pas limitées (user-
defined) le balisage est associé à une structure logique Arborescente (enracinée
dessinée) API DOM, SAX
le principe de formatage est celui des boites rectangulaires bien emboîtées (parenthèsées) XML bien formé
une DTD ou un Schéma XSD (non obligatoire) définit une structure logique générique (modèle SGML) XML valide
le Style est toujours séparé CSS, XSL, XSL-FO
XML supporte: des processeurs dédiés: XPath, XLink, XQuery,
XForms la définition de dialectes: SVG, MathML, RDF, SMIL, RSS… des transformations & échanges XSLT
XML est une recommandation W3C (1998) pour le transport et le stockage de données
XML est un métalangage (ou méta-modèle) les balises ne sont pas limitées (user-
defined) le balisage est associé à une structure logique Arborescente (enracinée
dessinée) API DOM, SAX
le principe de formatage est celui des boites rectangulaires bien emboîtées (parenthèsées) XML bien formé
une DTD ou un Schéma XSD (non obligatoire) définit une structure logique générique (modèle SGML) XML valide
le Style est toujours séparé CSS, XSL, XSL-FO
XML supporte: des processeurs dédiés: XPath, XLink, XQuery,
XForms la définition de dialectes: SVG, MathML, RDF, SMIL, RSS… des transformations & échanges XSLT
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 1311/04/23
Les exemples du W3C
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!– ou "UTF-8" -->
<note date='09/2011' auteur='PFZ'><to>SI4</to><from>Le Prof</from><sujet cours='LANGDOC' >Reminder</sujet><message>Don't forget your TP!</message></note>
Une note (message)
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 1411/04/23
Les exemples du W3C
<?xml version="1.0" encoding="ISO-8859-1" ?> <breakfast_menu>
<food> <price>$5.95</price>
<name>Belgian Waffles</name>
<description>two of our famous Belgian Waffles with plenty of real maple syrup</description>
<calories>650</calories>
</food><food><price>$7.95</price>
<name>Strawberry Belgian Waffles</name>
<description>light Belgian waffles covered with strawberries and whipped cream</description>
<calories>900</calories>
</food><food><price>$8.95</price>
<name>Berry-Berry Belgian Waffles</name>
<description>light Belgian waffles covered with an assortment of … and whipped cream</description>
<calories>900</calories>
</food><food><price>$4.50</price>
<name>French Toast</name>
<description>thick slices made from our homemade sourdough bread</description>
<calories>600</calories>
</food>
</breakfast_menu> Une carte de Menu
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 1511/04/23
XML - Objectifs
XML propose un "modèle syntaxique" (de type Entité-Relation) pour le transport et l'échange des Données
Data Storage Data Sharing Data Exchange Platform Change
XML permet la création de nouveaux Langages pour le Web XHTML WSDL for available web services WAP and WML for handheld devices RSS for news feeds RDF and OWL for resources and ontology SMIL for multimedia for the web
XML (contrairement à HTML) ne fait rien par lui-même
XML ne traite pas le "layout" (style) du format des données
XML propose un "modèle syntaxique" (de type Entité-Relation) pour le transport et l'échange des Données
Data Storage Data Sharing Data Exchange Platform Change
XML permet la création de nouveaux Langages pour le Web XHTML WSDL for available web services WAP and WML for handheld devices RSS for news feeds RDF and OWL for resources and ontology SMIL for multimedia for the web
XML (contrairement à HTML) ne fait rien par lui-même
XML ne traite pas le "layout" (style) du format des données
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
XML based Languages
XHTMLXHTML
SVGSVG
MATHMLMATHML
SMILSMIL
WSDLWSDL
SOAPSOAP
RSSRSS
RDFRDF
DOMDOM
XSDXSD
XPathXPath
XLinkXLink
XSLXSL
XML
Proce
ssor
s
XSL-FOXSL-FO
XQueryXQuery
XFormsXForms
Transparent 1711/04/23
l'Univers XML …
… en pleine expansion
CSSCSSCSSCSSCSSCSS
… des processeurs compatibles
… un metamodèle "pivot" universel
<?xml ?>
XUL
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 1811/04/23
XML - Le rôle des balises
Délimiter le texte (ou éléments)
Ordonner les éléments entre eux Hiérarchiser par imbrication
Créer des liens et autre relations entre données
Associer une fonction logique <version auteur='PFZ' date=' 2011' />
<note>
<from > </from>
<to> </to>
</note>
<sujet> Rappel </sujet>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Les exemples du W3C
<?xml version="1.0" encoding="ISO-8859-1" ?> <!– pour les accents --><CATALOG>
<CD>
<TITLE>Empire Burlesque</TITLE> <ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY> <COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE> <YEAR>1985</YEAR>
</CD>
<CD>
<TITLE>Hide your heart</TITLE> <ARTIST>Bonnie Tyler</ARTIST>
<COUNTRY>UK</COUNTRY> <COMPANY>CBS Records</COMPANY>
<PRICE>9.90</PRICE> <YEAR>1988</YEAR>
</CD>
</CATALOG>
•xml
Un catalogue de CD
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 2011/04/23
XML - Norme Lexicale les commentaires sont de la forme <!- - tout_sauf - - - - >
les balises "xml" (Prologue) sont de la forme <?xml tout_sauf < > & ?>
les DTD internes sont de la forme <?DOCTYPE tout_sauf > >
les autres balises (Eléments) sont de 3 formes: <NOM attribs > <NOM attribs /> </NOM >
les CHAINES sont de la forme " tout_sauf " < > & " ou ' tout_sauf ' < > & '
les NOMs sont de la forme [a-zA-Z_-][a-zA-Z0-9_-]* éventuellement précédé d'un préfixe (qualification de "Namespace") de la même forme séparé par :
les NOMs sont sensibles à la casse
les Attributs sont de la forme NOM = chaines
les sections <![CDATA[ ... ]]> pour du texte non analysé (sauf ]] )
le format est "libre" : les " " \t \r \n sont permis partout sauf dans les balises entre < ou </ et NOM
le reste (le texte pur) ne comprend pas < > & codés par < > &
les commentaires sont de la forme <!- - tout_sauf - - - - >
les balises "xml" (Prologue) sont de la forme <?xml tout_sauf < > & ?>
les DTD internes sont de la forme <?DOCTYPE tout_sauf > >
les autres balises (Eléments) sont de 3 formes: <NOM attribs > <NOM attribs /> </NOM >
les CHAINES sont de la forme " tout_sauf " < > & " ou ' tout_sauf ' < > & '
les NOMs sont de la forme [a-zA-Z_-][a-zA-Z0-9_-]* éventuellement précédé d'un préfixe (qualification de "Namespace") de la même forme séparé par :
les NOMs sont sensibles à la casse
les Attributs sont de la forme NOM = chaines
les sections <![CDATA[ ... ]]> pour du texte non analysé (sauf ]] )
le format est "libre" : les " " \t \r \n sont permis partout sauf dans les balises entre < ou </ et NOM
le reste (le texte pur) ne comprend pas < > & codés par < > &
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 2111/04/23
XML - Norme Syntaxique
Un source XML est dit "Bien Formé" (syntaxe) ssi
il est structuré suivant le schéma: un Prologue une Arborescence d'Eléments des Commentaires et Instructions de Traitement (facultatifs) dans
le prologue ou l'Arborescence
le Prologue se compose: d'une balise de déclaration <? xml ?> puis en option :
d'Instructions de Traitement (stylesheet, par ex) d'une déclaration de Type de Document (DTD) de commentaires <!-- -->
le source forme un système de textes, de balises, de commentaires et d'instructions de traitement bien parenthèsé et enraciné
Un source XML est dit "Bien Formé" (syntaxe) ssi
il est structuré suivant le schéma: un Prologue une Arborescence d'Eléments des Commentaires et Instructions de Traitement (facultatifs) dans
le prologue ou l'Arborescence
le Prologue se compose: d'une balise de déclaration <? xml ?> puis en option :
d'Instructions de Traitement (stylesheet, par ex) d'une déclaration de Type de Document (DTD) de commentaires <!-- -->
le source forme un système de textes, de balises, de commentaires et d'instructions de traitement bien parenthèsé et enraciné
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 2211/04/23
XML - Validation
Un source XML est dit "Valide" ssi il est "Bien Formé" il est conforme aux règles définies par:
une DTD ou un schéma XSD
Des erreurs dans la syntaxe XML stoppent le processus d'exécution de l'application associée au source XML (affichage, transformations, etc.)
(contrairement à HTML)
Outils de validation: IE, FF, DW, Nvu Via loadXML()(script) et le DOM Divers environnements(voir le Web)
Un source XML est dit "Valide" ssi il est "Bien Formé" il est conforme aux règles définies par:
une DTD ou un schéma XSD
Des erreurs dans la syntaxe XML stoppent le processus d'exécution de l'application associée au source XML (affichage, transformations, etc.)
(contrairement à HTML)
Outils de validation: IE, FF, DW, Nvu Via loadXML()(script) et le DOM Divers environnements(voir le Web)
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 2311/04/23
Navigateurs ("Web Browsers") Historiques:
Mosaîc, I.E. Netscape liste de navigateurs sur Wikipédia
Internet Explorer 6 => 9 ss Win, Linux HTML 4.01, XHTML 1.0, XML, CSS2, DOM
Safari 3 => 5 ss Mac OS, Win HTML 4.01, XHTML 1.0, XML, CSS2, DOM
Mozilla ss Win, Mac OS, Linux Firefox => 3.6.22 => 4.0 => ?.0
HTML 4.01, XHTML 1.0, XML, CSS2+, DOM
Opera 11 ss Win, Mac OS, Linux
Konqueror ss KDE
Google Chrome 13
Historiques: Mosaîc, I.E. Netscape liste de navigateurs sur Wikipédia
Internet Explorer 6 => 9 ss Win, Linux HTML 4.01, XHTML 1.0, XML, CSS2, DOM
Safari 3 => 5 ss Mac OS, Win HTML 4.01, XHTML 1.0, XML, CSS2, DOM
Mozilla ss Win, Mac OS, Linux Firefox => 3.6.22 => 4.0 => ?.0
HTML 4.01, XHTML 1.0, XML, CSS2+, DOM
Opera 11 ss Win, Mac OS, Linux
Konqueror ss KDE
Google Chrome 13
Un navigateur supporte la consultation du
Web (affichage des ressources).
Il comporte:
une couche réseau avec des protocoles: http: https: ftp:d'accès à des adresses URL.
un moteur de rendu: interpréteur html, css, xml, xsl, script, java,
etc.
une interface utilisateur: menus,
"widgets", historique, signets
un gestionnaire de "plugins" pour divers
formats
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 2411/04/23
Espaces de Noms "Namespaces"
Un mécanisme qui répond à 2 objectifs1. résoudre les conflits potentiels issus de sources multiples
(documents XML et HTML): Noms surchargés (cf Compilation: Visibilité & Portée)
2. regrouper (logiquement) des définitions à réutiliser Modules ou Classes Importation: Masquage & Héritage
Un mécanisme qui répond à 2 objectifs1. résoudre les conflits potentiels issus de sources multiples
(documents XML et HTML): Noms surchargés (cf Compilation: Visibilité & Portée)
2. regrouper (logiquement) des définitions à réutiliser Modules ou Classes Importation: Masquage & Héritage
<?xml version="1.0" ?>
<!-- Doc 1 -->
<table>
</table>
<?xml version="1.0" ?>
<!-- Doc 2 -->
<table>
</table><?xml version="1.0" ?>
<!-- fusion de Doc 1 & 2 -->
<table>
<!-- ?? -->
</table>
<table>
</table>
<table>
</table>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 2511/04/23
Conflits de Noms
Par Importations Multiples Par Importations Multiples
<?xml version="1.0" ?>
<!-- style HTML -->
<table>
<tr>
<td> ROUGE </td>
<td> VERT </td>
<td> BLEU</td>
</tr>
</table>
<?xml version="1.0" ?>
<!-- pour un EDT -->
<table>
<cours>
<jour> Lundi </jour>
<cren> 8h30-9h30</cren>
</cours>
</table><?xml version="1.0" ?>
<!-- fusion de documents -->
<table>
<!-- ?? -->
</table>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 2611/04/23
Nom Préfixé ou Qualifié ("QName")
Résolution des Conflits par des Préfixes Résolution des Conflits par des Préfixes
<?xml version="1.0" ?>
<!-- style HTML: préfixe h -->
<h:table>
<h:tr>
<h:td> ROUGE </h:td>
<h:td> VERT </h:td>
<h:td> BLEU</h:td>
</h:tr>
</h:table>
<?xml version="1.0" ?>
<!-- pour EDT: préfixe e -->
<e:table>
<e:cours>
<e:jour> Lundi </e:jour>
<e:cren> 8h30-9h30</e:cren>
</e:cours>
</e:table>
<?xml version="1.0" ?>
<!-- fusion de documents -->
<h:table> … </h:table
<e:table> … </e:table>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 2711/04/23
Espaces de Noms & URI
"Uniform Resource Identifier" (Clé universelle) "lexical" de type URL pour nommer un Espace de Noms chaque préfixe de nom qualifié est associé à un URI unique
Espaces de Noms des dialectes XML <!-- pour XHTML & MathML http://www.w3.org/1999/xhtml http://www.w3.org/1998/Math/MathML --> xs: <!-- préfixe des schémas XSD
http://www.w3.org/2001/XMLSchema --> xsl: <!-- préfixe des transformations XSL
http://www.w3.org/1999/XSL/Transform/ --> xlink: <!-- préfixe de XLink
http://www.w3.org/1999/xlink/ -->
Portée
"Uniform Resource Identifier" (Clé universelle) "lexical" de type URL pour nommer un Espace de Noms chaque préfixe de nom qualifié est associé à un URI unique
Espaces de Noms des dialectes XML <!-- pour XHTML & MathML http://www.w3.org/1999/xhtml http://www.w3.org/1998/Math/MathML --> xs: <!-- préfixe des schémas XSD
http://www.w3.org/2001/XMLSchema --> xsl: <!-- préfixe des transformations XSL
http://www.w3.org/1999/XSL/Transform/ --> xlink: <!-- préfixe de XLink
http://www.w3.org/1999/xlink/ -->
Portée<?xml version="1.0" ?>
<h:table xmlns:h= "http://www.w3.org/TR/html4/" >
</h:table>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 2811/04/23
Espaces de Noms "Namespace"
Attribut xmlns avec prefix xmlns:namespace-prefix="namespaceURI"
Attribut xmlns avec prefix xmlns:namespace-prefix="namespaceURI"
<?xml version="1.0" ?>
<!-- en XHTML: préfixe xh -->
<xh:table
xmlns:xh= "http://www.w3.org/1999/xhtml">
<xh:tr>
<xh:td> ROUGE </xh:td>
<xh:td> VERT </xh:td>
<xh:td> BLEU</xh:td>
</xh:tr>
</xh:table>
<?xml version="1.0" ?>
<!-- pour EDT: préfixe e -->
<e:table
xmlns:e= "http://www.essi.fr/edt" >
<e:cours>
<e:jour> Lundi </e:jour>
<e:cren> 8h30-9h30</e:cren>
</e:cours>
</e:table>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Espaces de Noms "Namespace"
Attribut xmlns par défaut xmlns = "namespaceURI"
Utilisations: XHTML, XLINK, XSD, XSL et dialectes
Attribut xmlns par défaut xmlns = "namespaceURI"
Utilisations: XHTML, XLINK, XSD, XSL et dialectes
Transparent 2911/04/23
Attribut xmlns par défaut xmlns = "namespaceURI"
Utilisations: XHTML, XLINK, XSD, XSL et dialectes
Attribut xmlns par défaut xmlns = "namespaceURI"
Utilisations: XHTML, XLINK, XSD, XSL et dialectes
<?xml version="1.0" ?>
<!-- en XHTML -->
<table
xmlns= "http://www.w3.org/1999/xhtml">
<tr>
<td> ROUGE </td>
<td> VERT </td>
<td> BLEU</td>
</tr>
</table>
<?xml version="1.0" ?>
<!-- pour EDT -->
<table
xmlns= "http://www.essi.fr/edt">
<cours>
<jour> Lundi </jour>
<cren> 8h30-9h30</cren>
</cours>
</table>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 3011/04/23
Uniform Resource Identifier (URI)
a URI is a string of characters which identifies an Internet Resource. The most common URI is the Uniform Resource Locator (URL) which identifies an Internet domain address.
les URI sont des clés "syntaxiques" (les URL permettent de définir une clé universelle).
les URI peuvent avoir un sens pour une application (interprétation à l'exécution pour un Navigateur, par ex.)
les préfixes sont purement "lexicaux" (libres et sans signification)
XSD – <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
XSLT – <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
XHTML – <html xmlns:"http://www.w3.org/1999/xhtml">
SVG – <svg xmlns:"http://www.w3.org/2000/svg">
XLINK – <liens xmlns:xlink="http://www.w3.org/1999/xlink">
SOAP – <soap xmlns:soap="http://schemas.xmlsoap.org/soap/envelope">
XLINK – <liens xmlns:xlink="http://www.w3.org/1999/xlink">
Dublin-Core – <dc:title xmlns:dc="http://purl.org/dc">
a URI is a string of characters which identifies an Internet Resource. The most common URI is the Uniform Resource Locator (URL) which identifies an Internet domain address.
les URI sont des clés "syntaxiques" (les URL permettent de définir une clé universelle).
les URI peuvent avoir un sens pour une application (interprétation à l'exécution pour un Navigateur, par ex.)
les préfixes sont purement "lexicaux" (libres et sans signification)
XSD – <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
XSLT – <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
XHTML – <html xmlns:"http://www.w3.org/1999/xhtml">
SVG – <svg xmlns:"http://www.w3.org/2000/svg">
XLINK – <liens xmlns:xlink="http://www.w3.org/1999/xlink">
SOAP – <soap xmlns:soap="http://schemas.xmlsoap.org/soap/envelope">
XLINK – <liens xmlns:xlink="http://www.w3.org/1999/xlink">
Dublin-Core – <dc:title xmlns:dc="http://purl.org/dc">
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 3111/04/23
Espaces de Noms par Défaut
Scalable Vector Graphics Scalable Vector Graphics
<?xml version="1.0" ?>
<!-- Scalable Vector Graphics -->
<svg xmlns= "http://www.w3.org/2000/svg/"
width="10cm" height="8cm" >
<rect x="100" y="100"
width="50" height="70" />
<ellipse rx="100" ry="200" />
</svg>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 3211/04/23
Portée des Espaces de Noms Multiples
<?xml version="1.0" ?>
<!-- SVG + XHTML + XLink -->
<html xmlns= "http://www.w3.org/1999/xhtml"
xmlns:xlink= "http://www.w3.org/1999/xlink" >
<body>
<h1> Rectangle et Ellipse </h1>
<svg xmlns= "http://www.w3.org/2000/svg"
width="21cm" height="29cm">
<rect x="10" y="10"
width="50" height="70" />
<ellipse rx="100" ry="200" />
</svg>
<p xlink:type="simple"
xlink:href="svgDoc.html" >
Pour en savoir plus sur SVG
</p>
</body>
</html>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 3311/04/23
Quelques Dialectes, parmi des centaines
SMIL – pour le Multimédia
CML – pour les formules chimiques
ATOM, RSS – pour les flux (syndication)
RDF – pour les ressources
WML – pour les mobiles (Wap)
MusicML – pour la musique
SVG – pour les graphiques vectoriels
MathML – pour les formules mathématiques
XUL – pour les Interfaces Mozilla
WordML – pour Office
KML – Google Earth & Maps http://code.google.com/apis/earth/kml-samples.googlecode.com
SMIL – pour le Multimédia
CML – pour les formules chimiques
ATOM, RSS – pour les flux (syndication)
RDF – pour les ressources
WML – pour les mobiles (Wap)
MusicML – pour la musique
SVG – pour les graphiques vectoriels
MathML – pour les formules mathématiques
XUL – pour les Interfaces Mozilla
WordML – pour Office
KML – Google Earth & Maps http://code.google.com/apis/earth/kml-samples.googlecode.com
Un dialecte XML définit un ensemble (Langage) de documents XML valides
par rapport à
une DTD
ou un schéma XSD
(les documents sont donc bien formés)
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 3411/04/23
SVG - Scalable Vector Graphics
<?xml version="1.0" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" version="1.1"
xmlns="http://www.w3.org/2000/svg">
<ellipse cx="240" cy="100" rx="220" ry="30"
style="fill:purple"/>
<ellipse cx="220" cy="70" rx="190" ry="20"
style="fill:lime"/>
<ellipse cx="210" cy="45" rx="170" ry="15"
style="fill:yellow"/>
</svg>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 3511/04/23
MathML: insertion dans XML
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/css" href="monMathML.css"?>
<Racine>
<Titre> Formule sous MathML </Titre>
<Math xmlns = " http://www.w3.org/1998/Math/MathML ">
<mroot> <msup>
<mfrac> <mi>A*B</mi> <mi>b</mi></mfrac>
<mn> 10 </mn>
</msup>
<mi>x</mi>
</mroot>
</Math>
</Racine>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 3611/04/23
XHTML - Introduction Une version « Xmlisée » de HTML 4.0
Recommandation W3C (Janvier 2000) au remplacement de HTML <html xmlns=‘‘http://www.w3.org/1999/xhtml’’>
XHTML 1.0: Compatibilité (presque) totale avec HTML 4.0
les documents doivent être « bien formés » au sens XML racine <html> </html> unique marqueurs de fermeture obligatoires: </p> </li> </td>ou <b /> et <img ….. />, avec un espace devant / balises bien emboîtées (parenthèsées) nom et attribut de balise en minuscule (sensibilité à la casse) valeurs d’attributs entre ‘‘ ’’ et valeurs explicites l’attribut id remplace name
XHTML 1.0: Trois DTDs de validation strict transitional framseset
Une version « Xmlisée » de HTML 4.0
Recommandation W3C (Janvier 2000) au remplacement de HTML <html xmlns=‘‘http://www.w3.org/1999/xhtml’’>
XHTML 1.0: Compatibilité (presque) totale avec HTML 4.0
les documents doivent être « bien formés » au sens XML racine <html> </html> unique marqueurs de fermeture obligatoires: </p> </li> </td>ou <b /> et <img ….. />, avec un espace devant / balises bien emboîtées (parenthèsées) nom et attribut de balise en minuscule (sensibilité à la casse) valeurs d’attributs entre ‘‘ ’’ et valeurs explicites l’attribut id remplace name
XHTML 1.0: Trois DTDs de validation strict transitional framseset
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 3711/04/23
XHTML- format
Source requis en XHTML1.0
Conseils d’utilisation protéger tous les caractères spéciaux: & < > séparer les scripts et les styles
Source requis en XHTML1.0
Conseils d’utilisation protéger tous les caractères spéciaux: & < > séparer les scripts et les styles
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> le Titre du Document </title>
<!-- les styles et les scripts (externalisés, c'est mieux) -->
</head>
<body>
le Corps du Document
</body>
</html>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 3811/04/23
XHML: insertion dans XML
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/css" href="xhtml.css"?>
<racine>
<titre> XHTML et XML</titre>
<html xmlns = " http://www.w3.org/1999/xhtml " >
<body>
<h1> Liens sous XHTML</h1>
<p>
<a href=" http://www.w3schools.comz "> Visit W3C Tutorial </a>
</p>
<p>
<a href=" http://www.essi.fr/~pfz ">chez Moi </a>
</p>
</body>
</html>
</racine>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
11/04/23
XML "Basic Know Hows"
XML Basics
XML & Styling: CSS
XML Dialects:
MathML, SVG
Document Definition:
DTD, XSD
XML Basics
XML & Styling: CSS
XML Dialects:
MathML, SVG
Document Definition:
DTD, XSD
.xml.xml
.css.css
.dtd.dtd .xsd.xsd.dtd.dtd.dtd.dtd
LexiqueLexique
Langages & Documents RéfsRéfs
TechsTechs
SommaireSommaire
..
..
..
..
.
..
Paul FranchiSI 5
2013-14
Chap VIII - XML Processeurs "Advanced"
XPath
XPointer
XLink
XInclude, XForms, XQuery
Techniques XML
XPath
XPointer
XLink
XInclude, XForms, XQuery
Techniques XML
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
Transparent 4111/04/23
XPath– Xml Paths
Un langage pour spécifier des chemins de localisation dans l’arborescence d’un document Xml
Chemins absolus ou relatifs de type "pathname" [ / ] étape 1 / étape 2 / …. / étape n
axes de cheminement /child:: /parent:: /attribute:: etc
sélection des nœuds filtres par le type des noeuds prédicats par des propriétés
2 versions XPath 1.0 & XPath 2.0
Un langage pour spécifier des chemins de localisation dans l’arborescence d’un document Xml
Chemins absolus ou relatifs de type "pathname" [ / ] étape 1 / étape 2 / …. / étape n
axes de cheminement /child:: /parent:: /attribute:: etc
sélection des nœuds filtres par le type des noeuds prédicats par des propriétés
2 versions XPath 1.0 & XPath 2.0
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
Transparent 4211/04/23
XML & XPath– Modèle Arborescent de DocumentLes documents XML sont traités comme des arborescences avec 7
types de nœuds et dont la racine est la balise "root" du document:
1. nœud Racine – unique & obligatoire 1. racine de l'arborescence du document
2. nœud Elément 1. délimité par les balises
3. nœud Attribut 1. attaché à un Nœud Elément, mais sans relation
4. nœud Commentaire 1. délimité par <!-- et -->
5. nœud "xmlns" - déclaration d'Espace de Noms1. un pour chaque Espace de Nom actif (déclaré ou défaut)
6. nœud "processing-instruction"1. délimité par <? et ?>
7. nœud Texte de type #PCDATA
Les documents XML sont traités comme des arborescences avec 7 types de nœuds et dont la racine est la balise "root" du document:
1. nœud Racine – unique & obligatoire 1. racine de l'arborescence du document
2. nœud Elément 1. délimité par les balises
3. nœud Attribut 1. attaché à un Nœud Elément, mais sans relation
4. nœud Commentaire 1. délimité par <!-- et -->
5. nœud "xmlns" - déclaration d'Espace de Noms1. un pour chaque Espace de Nom actif (déclaré ou défaut)
6. nœud "processing-instruction"1. délimité par <? et ?>
7. nœud Texte de type #PCDATA
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
Transparent 4311/04/23
XPath - Exemple d'expressions
Les expressions XPath permettent de sélectionner un nœud (ou un ensemble de) dans un document Xml
Les expressions XPath permettent de sélectionner un nœud (ou un ensemble de) dans un document Xml
<?xml version="1.0"
encoding="ISO-8859-1"?>
<bookstore>
<book>
<title lang="eng">
Harry Potter
</title>
<price>29.99</price>
</book>
<book>
<title lang="eng">
Learning XML
</title>
<price>39.95</price>
</book>
</bookstore>
Path Expression Sélection
bookstore All the child nodes
of the "bookstore" element
/bookstore The root element "bookstore"
Note: If the path starts with a slash ( / )
it always represents an absolute path to an element!
bookstore/book All "book" elements
that are children of "bookstore"
//book All "book" elements
no matter where they are in the document
bookstore//book All "book" elements
that are descendant of the "bookstore" element,
no matter where they are under the "bookstore"
//@lang All attributes that are named "lang"
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
Transparent 4411/04/23
XPath – Indicateurs de Relation - "axis"
relativement au Nœud Courant child les nœuds fils (axe par défaut)
attribute les attributs
parent le nœud parent
descendant les descendants - ni attributs, ni NS
ancestor les ascendants - ni attributs, ni NS
self le nœud courant lui-même
preceding-sibling les frères gauches
following-sibling les frères droits
preceding les précédants ds l'ordre - ni asc, ni attr
following les suivants ds l'ordre - ni desc, ni attr
descendant-or-self le nœud contexte et ses descendants
ancestor-or-self le nœud contexte et ses ascendants
namespace les espaces nominaux
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
Transparent 4511/04/23
XPath – Axes et Abréviations
. self::node()
.. parent::node()
Axe par défaut child::
/A /child::A
A/* child::A/child::*
@att attribute::att
@* attribute::*
A/@* child::A/attribute::*
Etape par défaut
descendant-or-self::
// /descendant-or-self::node()/
.// self::node()/descendant-or-self::node()/
A//B child::A/descendant-or-self::node()/child::B
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
Transparent 4611/04/23
XPath – Filtres (ou Déterminants)
text() les nœuds de type Text
comment() les nœuds de type Comment
* les nœuds de type Element
(sauf axe attribute & namespace)
node() tous les types de nœuds
processing-instruction()
un nœud "instruction"
exemples
//comment() les commentaires du document
/comment() les commentaires de la racine
/A/descendant::text() les textes d'un descendant de /A
/A//text() les textes sous /A/
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
Transparent 4711/04/23
XPath – Prédicats
/A/B/child::node()[position()=1] les premiers fils de /A/B
/A/B/child::node()[1] idem
/A/B [att1] les B avec un attribut att1
/A/B [att1='a1'] idem avec att1='a1'
/A/B [att1='a1' and position()=last()]
Idem avec B en dernière position
Et d'autres fonctions …
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
Transparent 4811/04/23
XPath – Interrogations sur une Base Documentaire
//TITRE tous les titres du document
/FILMs/FILM [TITRE='Alien'] tous les FILM à titre"Alien"
/A/B [att1] les B avec un attribut att1
/A/B [att1='a1'] idem avec att1='a1'
/A/B [att1='a1' and position()=last()]
Idem avec B en dernière position
Et d'autres fonctions …
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
Transparent 4911/04/23
XPath + DOM avec JavaScript
<script type="text/javascript">
//xpath une expression de chemin XPATH
// I.E var xmlDoc=new ActiveXObject ("Microsoft.XMLDOM"); xmlDoc.async=false; xmlDoc.load ("cdcatalog.xml") ;
firstFit=xmlDoc.selectNodes(xpath)[0];
// MozillaxmlDoc=document.implementation.createDocument("","",null); xmlDoc.async=false; xmlDoc.load("cdcatalog.xml")firstFit=document.evaluate(xpath, xmlDoc, null, XPathResult.ANY_TYPE,null)[0];
attValue=firstFit.getAttribute('someAtt'); //exemple
</script>
mozxpath.js
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
Transparent 5011/04/23
XLink – Xml Linking Language
Standard W3C d'expression de liens dans un document Xml
avantages comparés aux liens Html tout élément d'un document XML peut se comporter
comme un lien les liens Xlink utilisent XPointer et XPath pour référencer
un emplacement spécifique (fragment) à l’intérieur d’un document
peuvent importer du texte ou balisage XLink supporte des liens simples (type HTML) et des
liens étendus (multiples) pour lier plusieurs ressources ensemble.
Standard W3C d'expression de liens dans un document Xml
avantages comparés aux liens Html tout élément d'un document XML peut se comporter
comme un lien les liens Xlink utilisent XPointer et XPath pour référencer
un emplacement spécifique (fragment) à l’intérieur d’un document
peuvent importer du texte ou balisage XLink supporte des liens simples (type HTML) et des
liens étendus (multiples) pour lier plusieurs ressources ensemble.
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
Transparent 5111/04/23
XLink – Exemples
Lien sur le Web<ref
xmlns:xlink=‘‘http://www.w3.org/1999/xlink’’ xlink: type=‘‘simple’’
xlink: href=‘‘http://www.essi.fr/~pfz/LANGDOC/doc.xml#w3c’’xlink: show=‘‘ new’’xlink: actuate=‘‘onRequest ’’
/> W3C </ref>
Lien local<schema
xmlns:xlink=‘‘http://www.w3.org/1999/xlink’’ xlink: type=‘‘simple’’
xlink: href=‘‘Schemas/schema1.png’’xlink: show=‘‘ embed’’xlink: actuate=‘‘onLoad ’’
/>
Lien sur le Web<ref
xmlns:xlink=‘‘http://www.w3.org/1999/xlink’’ xlink: type=‘‘simple’’
xlink: href=‘‘http://www.essi.fr/~pfz/LANGDOC/doc.xml#w3c’’xlink: show=‘‘ new’’xlink: actuate=‘‘onRequest ’’
/> W3C </ref>
Lien local<schema
xmlns:xlink=‘‘http://www.w3.org/1999/xlink’’ xlink: type=‘‘simple’’
xlink: href=‘‘Schemas/schema1.png’’xlink: show=‘‘ embed’’xlink: actuate=‘‘onLoad ’’
/>
3 mais pas 4 ?3 mais pas 4 ?
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
Transparent 5211/04/23
XLink: un exemple d'insertion dans XML
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/css" href="xlink.css"?>
<racine>
<titre> Des Liens sous XML avec Xlink </titre>
<homepages xmlns:xlink = " http://www.w3.org/1999/xlink " >
---------------------------
<homepage xlink:type="simple"
xlink:href=" http://www.w3schools.com ">Visit W3Schools</homepage>
---------------------------
<homepage xlink:type="simple"
xlink:href=" http://www.essi.fr/~pfz ">Visit Paul Franchi</homepage>
---------------------------
</homepages>
</racine>
3 mais pas 4 ?3 mais pas 4 ?
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
Transparent 5311/04/23
XPointer – Xml Pointer LanguageUne extension des URL pour préciser un élément dans un
document Xml (parties spécifiques ou fragments) en utilisant des XPath expressions
version Html ancre interne<a name= "XPointer" ..cette page..</a><a id= "XPointer" ..cette page..</a>
référence externe<a href="http://www.essi.fr/~pfz/LANGDOC/doc.html#XPointer">
version Xml localisation des éléments du document via XPath syntaxe d’un pseudo cheminhttp://www.essi.fr/~pfz/LANGDOC/doc.xml#xpointer/1/2http://www.essi.fr/~pfz/LANGDOC/doc.xml#xpointer(id('Balise')/
avec /1/2 correspondant au chemin Xpath: /child::*[1]/ child::*[2]
Une extension des URL pour préciser un élément dans un document Xml (parties spécifiques ou fragments) en utilisant des XPath expressions
version Html ancre interne<a name= "XPointer" ..cette page..</a><a id= "XPointer" ..cette page..</a>
référence externe<a href="http://www.essi.fr/~pfz/LANGDOC/doc.html#XPointer">
version Xml localisation des éléments du document via XPath syntaxe d’un pseudo cheminhttp://www.essi.fr/~pfz/LANGDOC/doc.xml#xpointer/1/2http://www.essi.fr/~pfz/LANGDOC/doc.xml#xpointer(id('Balise')/
avec /1/2 correspondant au chemin Xpath: /child::*[1]/ child::*[2]
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
Transparent 5411/04/23
XML – XQuery
What is XQuery? XQuery is the language for querying XML data XQuery for XML is like SQL for databases XQuery is built on XPath expressions XQuery is supported by all major databases XQuery is a W3C Recommendation
What is XQuery? XQuery is the language for querying XML data XQuery for XML is like SQL for databases XQuery is built on XPath expressions XQuery is supported by all major databases XQuery is a W3C Recommendation
for $x in doc("books.xml")/bookstore/bookwhere $x/price>30order by $x/titlereturn $x/title
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
Transparent 5511/04/23
XML – XForms
What Is XForms? XForms is the next generation of
HTML forms XForms is richer and more flexible
than HTML forms XForms will be the forms standard in
XHTML 2.0 XForms is platform and device
independent XForms separates data and logic from
presentation XForms uses XML to define form data XForms stores and transports data in
XML documents XForms contains features like
calculations and validations of forms XForms reduces or eliminates the
need for scripting XForms is a W3C Recommendation
What Is XForms? XForms is the next generation of
HTML forms XForms is richer and more flexible
than HTML forms XForms will be the forms standard in
XHTML 2.0 XForms is platform and device
independent XForms separates data and logic from
presentation XForms uses XML to define form data XForms stores and transports data in
XML documents XForms contains features like
calculations and validations of forms XForms reduces or eliminates the
need for scripting XForms is a W3C Recommendation
<xforms><model><instance><person><fname/><lname/>
</person></instance><submission id="form1"
method="get"
action="submit.asp"/></model><input ref="fname"><label>First Name</label>
</input><input ref="lname"><label>Last Name</label>
</input><submit submission="form1"><label>Submit</label>
</submit></xforms>
LexiqueLexique
RéfsRéfs
TechsTechs
SommaireSommaire
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
Transparent 5611/04/23
XML – Autres Technologies (W3C et al.)
XPointer Point, Intervalle: pour spécifier des fragments de
document XML
XInclude pour "assembler" des documents XML
ATOM RSS WSDL etc.
XPointer Point, Intervalle: pour spécifier des fragments de
document XML
XInclude pour "assembler" des documents XML
ATOM RSS WSDL etc.
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 5711/04/23
Techniques XML
Style CSS multiples
DTD interne externe validation
XSD
DOM & JS & CDATA parsing & validation programmation DOM styleSheets[] XPath Fragments & XSLT
SVG animation
XSLT
AJAX
as MetaData RDF SPRY PHP
XUL
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 5811/04/23
XML & CSS multiples
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet title="Style de base"
href="cd_catalog.css" type="text/css"?>
<?xml-stylesheet title="Planche" rel="alternate"
href="cd_catalog_2.css" type="text/css"?>
<?xml-stylesheet title="Spirale" rel="alternate"
href="cd_catalog_3.css" type="text/css"?>
<CATALOG>
... / ...
</CATALOG>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 5911/04/23
XML & DTD interne
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE note[
<!ENTITY nbsp " " ><!ENTITY eacute "é" ><!ENTITY egrave "è" >
<!ELEMENT note (to+, from, heading?, body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]> <!- -<!ELEMENT note ANY> -->
<note>
<!-- <erreur> ERREUR de balise: BIEN FORMé, mais non VALIDE </erreur><to>Vous</to><to>Lés Autrès</to>
<from>Moi</from>
<heading>Rappel</heading>
<body> N'oubliez pas de rendre vos TPs !</body>
</note>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 6011/04/23
XML & DTD externe
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE note SYSTEM "note.dtd"><note>
<!-- <erreur> ERREUR de balise: BIEN FORMé, mais non VALIDE </erreur> -->
<to>Vous</to><to>Lés Autrès</to>
<from>Moi</from>
<heading>Rappel</heading>
<body>
N'oubliez pas de rendre vos TPs !
</body>
</note>
<!ELEMENT note (to+, from, heading?, body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
<!ENTITY nbsp " " >
<!ENTITY eacute "é" >
<!ENTITY egrave "è" >
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 6111/04/23
DTD – Validation
<!-- script sous IE 5.0 et + --><script type="text/javascript">var xmlDoc = new ActiveXObject("Microsoft.XMLDOM")xmlDoc.async="false"xmlDoc.validateOnParse="true"xmlDoc.load("note_dtd_error.xml")document.write("<br>Error Code: ")document.write(xmlDoc.parseError.errorCode)document.write("<br>Error Reason: ")document.write(xmlDoc.parseError.reason)document.write("<br>Error Line: ")document.write(xmlDoc.parseError.line)</script>
Avec le W3C Validator on-lineAvec xmllint ss libxmlAvec le parseur XML sous DOM
• load(), loadXML() pour fichiers, chaînes XML
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 6211/04/23
<?xml version="1.0" encoding="iso-8859-1"?>
<note xmlns="si4/langDoc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="si4/langDoc note.xsd">
<!-- <erreur>
BIEN FORMé, mais non VALIDE
</erreur> -->
<to>Vous</to>
<to>Les Autres</to>
<from>Moi</from>
<heading>Rappel</heading>
<body>
N'oubliez pas de rendre vos TPs !
</body>
</note>
<?xml version="1.0" encoding="iso-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace= "si4/langDoc"
xmlns="si4/langDoc"
elementFormDefault="qualified" >
<xs:element name="note"> <xs:complexType> <xs:sequence>
<xs:element name="to" type="xs:string" maxOccurs="unbounded"/>
<xs:element name="from" type="xs:string"/>
<xs:element name="heading" type="xs:string" minOccurs="0"/>
<xs:element name="body" type="xs:string"/>
<xs:element name="erreur" type="xs:string"/>
<!– <xs:element name="erreur" type="xs:string"/> -->
</xs:sequence> </xs:complexType> </xs:element>
</xs:schema>
XML & XSD
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 6311/04/23
DOM - "Parser" un document XML(1)
<html>
<head>
<script type="text/javascript">
var xmlDoc
function loadXML() { //load a xml file
// code for IE
if (window.ActiveXObject) {
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.validateOnParse = "false" // "true" pour valider avec une DTD
xmlDoc.load("note.xml");
getmessage()
}
// continue sur le suivant
Script en HTML sous I.E. : Script en HTML sous I.E. :
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 6411/04/23
DOM - "Parser" un document XML(2)
// suite du précédent
// code for Mozilla, etc.
else if (document.implementation && document.implementation.createDocument) {
xmlDoc = document.implementation.createDocument("","",null);
xmlDoc.load("note.xml");
xmlDoc.onload =getmessage();
}
else { alert('Your browser cannot handle this script'); }
} // fin de loadXML()
// continue sur le suivant
Script en HTML sous Mozilla :
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 6511/04/23
DOM - Programmation
function getmessage() {
document.getElementById("to").innerHTML =
xmlDoc.getElementsByTagName("to")[0].firstChild.nodeValue
document.getElementById("from").innerHTML =
xmlDoc.getElementsByTagName("from")[0].firstChild.nodeValue
document.getElementById("message").innerHTML =
xmlDoc.getElementsByTagName("body")[0].firstChild.nodeValue
} // fin de getmessage()
</script> </head>
<body onload="loadXML()">
<div id="to" style="background-color:pink"> ……. </div>
<div id="from" style="background-color:pink"> ……. </div>
<div id="message" style="background-color:pink"> ……. </div></body> </html>
Exemple: viewNote.html Exemple: viewNote.html
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 6611/04/23
XML & CDATA (script JS interne)
<?xml version="1.0" standalone="no"?>
<dateur>
<titre> Date/Time: JS en XML</titre>
<script xmlns=http://www.w3.org/1999/xhtml
type="text/javascript" >
<![CDATA[
function ANIM(){ .. ./ ..... }
function INIT() { .... / ....}
]]> </script>
<body xmlns="http://www.w3.org/1999/xhtml" onload='INIT()'>
<box id="date">jeudi 10 avril 2008</box>
<box id="heures">9</box>
<box id="minutes">43</box>
<box id="secondes">17</box>
</body>
</dateur>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 6711/04/23
DOM + styleSheets[ ]
<script type="text/javascript">
<![CDATA[
function style(n) {
var out = "Stylesheet " + n + "<br />";
out += "title = '"+ document.styleSheets[n].title + "'<br />";
out += "href = '" + document.styleSheets[n].href + "'<br />";
out += "type = '" + document.styleSheets[n].type + "'<br />";
out += "disabled = '" + document.styleSheets[n].disabled + "'<br />";
document.getElementById('OUT').innerHTML+="<p>"+out+"</p>" ;
}
function dis() {
document.styleSheets[0].disabled = !document.styleSheets[0].disabled;
document.styleSheets[1].disabled = !document.styleSheets[1].disabled;
}
]]>
</script>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 6811/04/23
SVG+ JS+DOM - Animation: "Clock"
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" version="1.1"
xmlns:xlink="http://www.w3.org/1999/xlink" >
<script type="text/javascript"> <![CDATA[
function $(id) {return document.getElementById(id)};var centre=$("small");function ANIM() { // mise à l'heure a=new Date(); h=a.getHours()%12; m=a.getMinutes(); s=a.getSeconds(); m+=s/60; h+=m/60; // ring centre.setAttribute("fill", "grey"); if (s%5==0) {centre.setAttribute("fill", "green");} if (s%15==0) {centre.setAttribute("fill", "red");}// aiguilles $("heures").setAttribute("x2", Math.cos((h-3)/6*pi)*25+50); $("heures").setAttribute("y2", Math.sin((h-3)/6*pi)*25+50); $("minutes").setAttribute("x2", Math.cos((m-15)/30*pi)*35+50); $("minutes").setAttribute("y2", Math.sin((m-15)/30*pi)*35+50); $("secondes").setAttribute("x2", Math.cos((s-15)/30*pi)*45+50); $("secondes").setAttribute("y2", Math.sin((s-15)/30*pi)*45+50); setTimeout("ANIM()", 900); // <1000 = 1 sec } ANIM(); // appel de l\'animation ]]> </script> </svg>
<!-- le décor de l'horloge --> .
<g stroke="black">
<line x1="50" id="secondes" />
<line x1="50" id="minutes" />
<line x1="50" id="heures" /> </g>
<g stroke="black" id="marques">
<circle cx="50" cy="50" r="9" id="small"/>
</g>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 6911/04/23
XPath + DOM avec JS
<html><body><script type="text/javascript">//xpath une expression de chemin XPATH
// I.E var xmlDoc=new ActiveXObject ("Microsoft.XMLDOM"); xmlDoc.async=false; xmlDoc.load ("cdcatalog.xml") ;firstFit=xmlDoc.selectNodes(xpath)[0];
// MozilllaxmlDoc=document.implementation.createDocument("","",null); xmlDoc.async=false; xmlDoc.load("cdcatalog.xml")firstFit=document.evaluate(xpath, xmlDoc, null, XPathResult.ANY_TYPE,null)[0];
attValue=firstFit.getAttribute('someAtt'); //exemple</script></body></html>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 7011/04/23
JS + DOM + XSLT
function transform (xml, xsl, id) { try { // navigateur basé sur Gecko if (window.XSLTProcessor) { var fragment; var xsltProcessor = new XSLTProcessor(); xsltProcessor.importStylesheet(xsl); fragment = xsltProcessor.transformToFragment(xml, document); var target = document.getElementById(id); target.innerHTML = fragment.firstChild.innerHTML ; // pfz //target.appendChild(fragment); //orig //document.replaceChild(target, fragment); //orig
// ActiveX pour Internet Explorer } else if (window.ActiveXObject) { var target = document.getElementById(id); target.innerHTML = xml.transformNode(xsl); } } catch (e) {return e;}}
<script type="text/javascript">
var XML=
loadXML(xmlURL);
var XSL=
loadXML(xslURL);
function theJobTe()
{
transform (XML, XSL, 'ICI');
....
}
</script>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 7111/04/23
<script type="text/javascript">
<![CDATA[
var xmlhttp;
function loadXMLDoc(path) {
xmlhttp=null;
if (window.XMLHttpRequest) {// code for IE7, Firefox, Mozilla, etc.
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
xmlhttp=new XMLHttpRequest(); }
else if (window.ActiveXObject) {// code for IE5, IE6
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
if (xmlhttp!=null) {
xmlhttp.onreadystatechange=onResponse;
xmlhttp.open("GET", path, true);
xmlhttp.send(null); }
else { alert("Your browser does not support XMLHTTP."); }
}
// à suivre XML + AJAX
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 7211/04/23
XML + AJAX
// suite du précédent
function onResponse(){
if(xmlhttp.readyState!=4) return;
if(xmlhttp.status!=0 && xmlhttp.status!=200) {
alert("Problem retrieving XML data");
return; }
} // traitement du texte sourcevar SOURCE = xmlhttp.responseText ;…
// traitement du xmlvar XML =xmlhttp.responseXML ;…
]]></script>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 7311/04/23
XML as MetaData
XMI pour UML
WSDL pour SOAP/RSS
SMIL pour le Multimédia
RDF
XML et PHP/SQL
XML/RDF et SPRY, XUL,
XMI pour UML
WSDL pour SOAP/RSS
SMIL pour le Multimédia
RDF
XML et PHP/SQL
XML/RDF et SPRY, XUL,
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 7411/04/23
XML metadata pour EXEMPLES/
<?xml version='1.0' encoding='ISO-8859-1'?><?xml-stylesheet href="docExShow.xsl" type="text/xsl" ?><Doc base ="../">****************** BIB ***********<Exemples dossier='BIB' base='BIB/' auteur='pfz' version='2009'><Ex cle="BIB">
<Path>bib1.html</Path> <Title>bib1</Title > <Style></Style></Ex><Ex cle="BIB">
<Path>bib2.html</Path> <Title>bib2</Title> <Style></Style></Ex>
<Ex cle="CSS BIB"><Path>bib.html</Path><Title>bib</Title><Style><Css><href>bib.css</href></Css></Style>
</Ex></Exemples>****************** SPRY ***********<Exemples dossier='SPRY' base='SPRY/' auteur='pfz' version='2009'><Ex cle="SPRY CSS">
<Path>spry.html</Path><Title>spry</Title>
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
11/04/23
XML as metadatas
SPRY (Adobe Labs) using XML to describe "contents"
using JS & DOM to generate wIdgets & "contents"
using AJAX to access/modify "contents"
from RDF, XML to PHP/SQL using XML/RDF to describe "contents"
using XSLT from XML to SQL
exporting from SQL to XML
XSLT using XML/RDF to describe "contents"
using XSLT to generate wIdgets (DHTML, JS)
using XSLT to generate/modify "contents" (HTML)
using XSLT to generate/modify style (CSS)
SPRY (Adobe Labs) using XML to describe "contents"
using JS & DOM to generate wIdgets & "contents"
using AJAX to access/modify "contents"
from RDF, XML to PHP/SQL using XML/RDF to describe "contents"
using XSLT from XML to SQL
exporting from SQL to XML
XSLT using XML/RDF to describe "contents"
using XSLT to generate wIdgets (DHTML, JS)
using XSLT to generate/modify "contents" (HTML)
using XSLT to generate/modify style (CSS)
XUL (Mozilla Foundation) using RDFL to describe
"contents"
using XUL to generate
WIdgets & "contents"
using AJAX to access
"contents"
using JASON, XML-RPC,
WSDL for "networking" and
"web services"
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
JSJS
11/04/23
R.I.A. - XML as metadatas & SPRY
CSS, XSLCSS, XSL
HTMLHTML
DHTMLDHTML AJAXAJAX
SPRYSPRY
Rich Client
XML
rdf
XML
rdf
DHTMLDHTML
XML
rdf
XML
rdf
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
XSLXSLJSJS
11/04/23
XML as metadatas & PHP/SQL
CSS, XSLCSS, XSL
PHPPHP
HTMLHTML
XMLXMLXMLXML AJAXAJAX
LexLex
XSLTXSLT
SQLSQL
3-tier Client/Server Architecture
XML
rdf
XML
rdf
contourner
un bug Office
contourner
un bug Office
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
XSLXSLJSJS
11/04/23
XML as metadatas & XSLT
CSSCSS
HTMLHTML
XSLTXSLT
XML
rdf
XML
rdfXMLXML
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 7911/04/23
Web Reference Browser
de XML vers HTML5+CSS3
html
xml
css
via xsl
css
dtd
xsd
metadata .xml metadata .xml
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 8011/04/23
Doc Example Browser
de XML vers HTML5+CSS3+JS
html
metadata xml
css
via xsl
xsd
dtd
jscss
css
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
Transparent 8111/04/23
XML (meta) modèle de données (ERD )
<Code•titre
•keywords•file
•version>
<Description•libellé*
•img?>
<Categorie •type•path
>
<Show•version
>1,*
1,*
1,?
<Auteur>n,m
uses: n,mused_by: n,m
TypeType
AutAutPathPath
KeywordKeywordKeywordKeyword
KeywordKeywordKeywordKeyword
KeywordKeyword
LexiqueLexique
RéfsRéfs
Exemples du W3C
Norme Lexicale
Norme Syntaxique
XHTML
Namespaces
SVG
MathML
XML MetaData
XML Know Hows"
XML "State of the Art"
XPath
XPointer
XLink
XQueryXFormsXML Techno
l'Univers XML
Validation
TechsTechs
SommaireSommaire
11/04/23
XML: "State of the Art"
XML Processing: XSLT, XPath, XLink
Dynamic XML using
XSL/JS
XML as metadata:
RDF, SPRY, XUL
XML Processing: XSLT, XPath, XLink
Dynamic XML using
XSL/JS
XML as metadata:
RDF, SPRY, XUL
.xsl.xslXML
rdf
XML
rdf
XML
rdf
XML
rdf