Cours ‘Semantic web’

Document Sample
Cours ‘Semantic web’ Powered By Docstoc
					  Michel Crampes           Cours XSLT et Xpath               Septembre 2002




               Cours ‘Semantic web’
                                     Partie 1 : XML
                             Partie 2 XML Namespaces

                      Partie 3 : XSLT et Xpath
                       Partie 4 : Connaissance et RDF/RDFS
                           Partie 5 : Ontologie et DAML
                   Partie 6 : Données Information et Connaissance


Prérequis pour ce cours :
cours XML
connaissance syntaxe EBNF (voir document de référence XML 1.0)




Michel Crampes
Ecole des Mines d‟Ales
Janvier_Mars ... Septembre 2002
  Michel Crampes            Cours XSLT et Xpath                     Septembre 2002




                   Rappels sur XML 1.0 (1/2)
Nota1 : Le lecteur comprendra la syntaxe ci-dessous qui adapte une syntaxe EBNF
simplifiée. Les „“‟ et les “‟“ sont à interpréter selon les circonstances).
Nota2 : cette page est à corriger et valider
      Un document XMl commence toujours par la balise :
            “< ?xml version=‟1.0‟>”
      La version est en général 1.0)
      Par défaut, les caractères sont UTF-8.
      Pour un document en français avec caractère accentués, utiliser la déclaration :
      “<?xml version = '1.0' encoding='ISO-8859-1' ?>”


Un document XML est un arbre construit à partir de sept types
de noeuds. Il doit être bien formé, c’est-à-dire respecter des
principes syntaxiques tels que l’emboitement des balises.

Le noeud racine (unique : ‘root’) :
      c‟est un élément unique dont la balise de début commence un document XML et
      la balise de fin le cloture.
Les noeuds ‘element’ :
      Un élément peut être vide „<‟ <nom et attributs de l‟élément> „/>‟
      ou peut contenir du texte PCDATA et/ou des enfants (children) :
      „<‟ NomElément [+attributs]„>‟ <children et/ou texte> „</‟<NomElément>„>‟
Les noeuds ‘attribute’ :
      „<‟ < NomElément > (<NomAttribut> „= “‟ <valeurAttribut> „“‟)* [„/‟] „>‟
Les noeuds ‘text’ :
      texte entre les balises.
Les noeuds ‘comment’ :
       „< !--‟ <texte du commentaire...> „-->‟
Les noeuds ‘processing instruction :
      „< ?‟ <nomProgramme> <paramètresProgramme> „ ?>‟
Les noeuds ‘namespace’ :
      „xmlns‟ („=‟| „:‟ <nomPréfixe>„=‟) <uri>
  Michel Crampes          Cours XSLT et Xpath                       Septembre 2002




                   Rappels sur XML 1.0 (2/2)
Les entités (entity)
      Ce sont des références à des caractères ou des groupes de caractères. Certaines
      entités sont prédéfinies (par ex : &lt ; pour le caractère <), d‟autres peuvent être
      prédéfinies par le programmeur dans la DTD. Une entité est déclarée dans la DTD
      selon la syntaxe : entité : : = „< !ENTITY ‟ [„%‟] <nom de l‟entité> „ “‟ <texte de
      l‟entité (attention ce texte doit être bien formé)> „”>‟ .

La DTD (Document Type Definition)
      Elle définit la structure du document (nom et organisation des noeuds)
      Elle est déclarée après l‟en-tête xml. Syntaxe :
      DTD : : = „< !DOCTYPE‟ <nom de la racine> „[‟ <déclaration des entités
      paramétrés, des entités fixes, des éléments, atttributs> „]‟

Un document XML valide est un document qui est conforme à la DTD. Une DTD peut
être déclarée interne (attachée au document), ou externe. Exemple d‟un appel à une DTD
externe :
<?xml version = "1.0" encoding='ISO-8859-1' standalone ='no'?>
<!DOCTYPE stars SYSTEM '
http://www.ema.fr/~mcrampes/Cours_%20semantic_web/Stars.dtd'>
<stars>
</stars>


DTD composite
Une DTD peut être composée d‟une DTD interne et d‟une DTD externe. Dans ce cas, les
éléments et attributs externes ne doivent pas être réécrits.
  Michel Crampes              Cours XSLT et Xpath           Septembre 2002




                                     Références
http://saxon.sourceforge.net/saxon6.5.2/instant.html
[saxon2001] On trouve à ce site un parser XSLT et un résumé de
XSL elements , XSL expressions (Xpath), XSL patterns , XSL conformance , SAXON
extensions


[XSLT 1999] XSL Transformations (XSLT)
Version 1.0
W3C Recommendation 16 November 1999
Latest version: http://www.w3.org/TR/xslt
  Michel Crampes         Cours XSLT et Xpath                     Septembre 2002




                    XSLT (par l’exemple)
XSLT : eXtensible Stylesheet Language Transform

Permet de transformer un document XML en ... le document que l‟on veut (ou presque).
On peut le transformer en du texte, en des requêtes SQL, en des documents HTML, en
des documents XML quelconques. On peut même lui appliquer des traitements de type
Java

Exemple : Soit le document XML (figure 1):
<?xml version = "1.0" encoding='ISO-8859-1' ?>
<!-- stars9.xml , aout 2002, auteur : Michel Crampes -->
<stars>
     <star age="54" agent='Picsou' ID='Johny Haliday'>
     Connu pour son attitude <attitude>'rock n'roll</attitude>,
     <prenom> Johnny </prenom> <nom> Haliday </nom> est un
     <profession>   chanteur de rock </profession>. Parmi ses
     nombreux succès, on compte des titres comme <succes> allumer le
     feu </succes>, <succes> l'idole des jeunes </succes>, ou encore
     , <succes> Gabrielle </succes>.
     Ses aventures amoureuses nombreuses (<relation_amoureuse> Sylvie
     Vartan </relation_amoureuse>, <relation_amoureuse> Nathalie
     Bayle </relation_amoureuse> , etc. ) font de lui un abonné des
     revues 'people'.
     </star>

     <star age="68" agent='Dugoumier' ID='Marcel Dugoumier'>
     <nom> Dugoumier </nom> <prenom> Marcel </prenom> <Commentaires>
     est sans nul doute le meilleur, mais aussi le plus méconnu des
     chanteurs de rock. Parmi ses nombreux succès, on compte en
     particulier <succes> 'Le tube de Marcel' </succes>
     </Commentaires>
     </star>
     <star age="caché" agent='Picsou' ID='Sylcie Vartan'>
     <nom> Vartan </nom> <prenom> Sylvie </prenom>
     <Commentaires> La femme de Johnny dans les années 60. <succes>
     </succes> </Commentaires>
     </star>
<!-- autre star ... -->
</stars>

Nous nous proposons de manipuler ce document de diverses manières à l‟aide de feuilles
de style XSLT (voir modalités page suivante)
  Michel Crampes            Cours XSLT et Xpath                         Septembre 2002




                   Feuille de style : exemple 1
Méthode :
Pour ce faire, on va créer une feuille de style (on va nommer les feuilles de style
starsxsl0.xsl, puis starsxsl1.xsl, etc.). On déclarera la feuille de style que l‟on veut
appliquer dans l‟instruction de traitement xml:stylesheet que l‟on trouve dans le
prologue.

Le prologue du document d‟entrée de la figure 1 devient (figure 2):
<?xml version = "1.0" encoding='ISO-8859-1' ?>
<!-- stars9.xml , aout 2002, auteur : Michel Crampes -->
<?xml:stylesheet type = "text/xsl" href = "starsxsl.xsl" ?>
(puis <stars> etc.)

Nota : cette feuille de style est ici dans le même répertoire pour des raisons de
simplification:

Exemple 0 : feuille de style minimale (figure 3):
<?xml version = '1.0'?>
<!-- starsxsl.xsl, aout 2002, auteur : Michel Crampes -->
<xsl:stylesheet version= '1.0'
    xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
</xsl:stylesheet>

Résultat (figure 4):
Pour obtenir le résultat, appeler stars9.xml sous Internet Explorer 5.5

Connu pour son attitude 'rock n'roll, Johnny Haliday est un chanteur de rock . Parmi ses
nombreux succès, on compte des titres comme allumer le feu , l'idole des jeunes , ou encore
, Gabrielle . Ses aventures amoureuses nombreuses (Sylvie Vartan , Nathalie Bayle , etc. )
font de lui un abonné des revues 'people'. Dugoumier Marcel est sans nul doute le meilleur,
mais aussi le plus méconnu des chanteurs de rock. Parmi ses nombreux succès, on compte
en particulier 'Le tube de Marcel' Vartan Sylvie La femme de Johnny dans les années 60.


Observer :
Le texte (bien formé) est rendu sous Explorer sans les balises.

Explication (à comprendre plus tard):
Le processeur XSLT contient des selecteurs par défaut (voir plus loin : défauts)
  Michel Crampes          Cours XSLT et Xpath                      Septembre 2002




  Déclaration d’une Feuille de Style (FS)
Reprenons la feuille de style (FS) précédente (figure 3):
<?xml version = '1.0' encoding='ISO-8859-1'?>
<!-- starsxsl.xsl, aout 2002, auteur : Michel Crampes -->
<xsl:stylesheet version= '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
</xsl:stylesheet>

Observer :

 Une FS est un document XML bien formé . Elle comprend donc une
  déclaration XML (<?xml version = '1.0'?>).
 Une FS peut avoir une DTD, mais en général elle n‟en a pas.
 Une feuille de style s‟applique sur un document XML (ci-dessus
  stars9.xml) bien formé (non nécessairement valide)
 Les éléments de la FS sont pris dans le domaine nominal
  http://www.w3.org/1999/XSL/Transform (l‟adresse doit être exacte)
 On donne aux éléments XSLT le préfixe standard xsl
 La racine est stylesheet ou transform
 La version est 1.0 (la version 1.1 n‟est pas supportée par IE5.5)

Les processeurs XSLT :
 Intégrés dans des navigateurs comme IE5.5
(Attention aux versions de navigateurs. L‟application de FS peut connaître des variantes
(qui devraient se stabiliser))
 Ce peut être aussi un programme „standalone‟ exécuté à partir d‟une ligne de
   commande (voir SAXON ou Xalan).

Appel de la feuille de style dans un navigateur :
Il se fait via une instruction de traitement XML dont le pseudo-attribut „type‟ a pour
valeur text/xsl"
Dans l‟exemple stars9.xml (figure1)on rajoute au prologue l’instruction
de traitement (voir figure 2):
<?xml:stylesheet type = "text/xsl" href = "starsxsl.xsl" ?>
Ici pour appeler la FS starsxsl.xsl qui se trouve dans le même répertoire que
stars9.xml
  Michel Crampes             Cours XSLT et Xpath                      Septembre 2002




  Utiliser le sélecteur ‘template ... match’
Exemple style01 (figure 5):
<?xml version = '1.0' encoding='ISO-8859-1'?>
<!-- starsxsl01.xsl, aout 2002, auteur : Michel Crampes -->

<xsl:stylesheet version= '1.0'
    xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
    <xsl:template match='star'>
    Une star
    </xsl:template>
</xsl:stylesheet>

Résultat :
(appelons stars9.xml avec la nouvelle feuille de style starsxsl01.xsl sous
Internet Explorer 5.5)
On obtient :

Une star Une star Une star

Observation :
Pour établir quel doit être le document en sortie à partir du document d‟entrée, la feuille
de style utilise des sélecteurs définis par des „templates‟. Dans l‟exemple :
       <xsl:template match='star'>

Entre les deux balises du template, la FS définit ce que doit faire le processeur XSLT
quand il rencontre l‟élément identifié par la valeur de l‟attribut match.
Ici, il doit écrire Une star.
Trois éléments stars sont rencontrés dans starsxsl01.xsl, et donc Une star est écrit trois
fois

„Une personne‟ est un texte simple composé de „caractères littéraux‟
Un „template‟ peut contenir des structures plus complexes composées d‟éléments.
Voir page suivante.
  Michel Crampes           Cours XSLT et Xpath                       Septembre 2002




           Principes d’une Feuille de Style
D’un arbre source à un arbre résultat
« A stylesheet generally contains a set of template rules. A template rule has two parts:
a pattern which is matched against nodes in the source tree and a content constructor
which is evaluated to create new nodes that are written to a result tree. »

Template Rule
« A template rule associates a pattern, which matches nodes in the source document,
with a content constructor, which can be evaluated to produce part of a result tree. The
structure of the result trees can be completely different from the structure of the source
trees. In constructing a result tree, nodes from the source trees can be filtered and
reordered, and arbitrary structure can be added. This mechanism allows a stylesheet to
be applicable to a wide class of documents that have similar source tree structures. »

Syntaxe de xsl:stylesheet
      <xsl:stylesheet
      id = id
      extension-element-prefixes = tokens
      exclude-result-prefixes = tokens
      exclude-prefixes = tokens
      version = number
      default-xpath-namespace = uri>
      <!-- Content: (xsl:import*, top-level-elements) -->
      </xsl:stylesheet>
Permitted parent elements:
      None
  Michel Crampes            Cours XSLT et Xpath                         Septembre 2002




                      Content Constructors
« Whether the stylesheet is written to use push processing or pull processing, nodes in
the result tree are always generated using content constructors. »

« A content constructor is evaluated for a particular node in the source tree, to create part
of the result tree. A content constructor can contain elements (called literal result
elements) and text nodes that specify part of the result structure directly. A content
constructor can also contain elements from the XSLT namespace that are instructions for
creating parts of the result tree. »

« When a content constructor is evaluated, each instruction is evaluated to produce a
sequence of zero or more nodes; the result of the content constructor as a whole is a
sequence of nodes formed by concatenating the results of each of the instructions and
literal results nodes that it contains, in the order that they appear in the content
constructor. »

« The resulting nodes are typically attached as children to an element or document node
constructed by the instruction that contains the content constructor, thus forming a tree.
During this process, adjacent text nodes will be merged into a single text node. »

« When a content constructor is evaluated to create new nodes, the tree to which these
nodes are added is referred to as the current result tree. When the transformation is
initiated, a result tree is created, and becomes the current result tree. This tree is referred
to as the principal result tree. Various XSLT instructions (including xsl:variable and
xsl:result-document) establish a new current result tree for the nodes created by the
content constructor that they contain. »

« The elements occurring within a content constructor are classified as being either
literal result elements or instructions. If the element is in the XSLT namespace, or in a
namespace designated as an extension namespace, then it is an instruction. Otherwise, it
is a literal result element. »
  Michel Crampes           Cours XSLT et Xpath                     Septembre 2002




                     ‘Stylesheet’ composée
« A stylesheet may consist of several stylesheet modules, contained in different XML
documents. For a given transformation, one of these functions as the principal
stylesheet module. The complete stylesheet is assembled by finding the stylesheet
modules referenced directly or indirectly from the principal stylesheet module using
xsl:include and xsl:import elements: see [3.8.1 Stylesheet Inclusion] and [3.8.2
Stylesheet Import]


Syntaxe de xsl:import (voir détails plus loin)
Category: declaration
Model:
      <xsl:import
         href = uri-reference />
Permitted parent elements:
            xsl:stylesheet
            xsl:transform

Syntaxe de xsl:import-schema (voir détails plus loin)
Category: declaration
Model:
      <xsl:import-schema
         namespace = uri-reference
         schema-location = uri-reference />
Permitted parent elements:
            xsl:stylesheet
            xsl:transform

Syntaxe de xsl:include (voir détails plus loin)
Category: declaration
Model:
      <xsl:include
         href = uri-reference />
Permitted parent elements:
            xsl:stylesheet
            xsl:transform
  Michel Crampes           Cours XSLT et Xpath                      Septembre 2002




                         Top level elements
An element occurring as a child of an xsl:stylesheet element is called a top-level
element.
Top-level elements fall into two categories: declarations, and user-defined data elements.
Top-level elements whose names are in the XSLT namespace are declarations. Top-
level elements in any other namespace are user-defined data elements (see [3.4.1 User-
defined Data Elements])
The xsl:stylesheet element may contain the following types of declaration:
    xsl:import
    xsl:include
    xsl:attribute-set
    xsl:decimal-format
    xsl:function
    xsl:import-schema
    xsl:key
    xsl:namespace-alias
    xsl:output
    xsl:param
    xsl:preserve-space
    xsl:principal-result-document
    xsl:sort-key
    xsl:strip-space
    xsl:template
    xsl:variable

If there are xsl:import elements, these must come before any other elements. Apart from
this, the child elements of the xsl:stylesheet element may appear in any order. The
ordering of these elements does not affect the results of the transformation unless there
are conflicting declarations (for example, two template rules with the same priority that
match the same node). In general, it is an error for a stylesheet to contain such
conflicting declarations, but in some cases the processor is allowed to recover from the
error by choosing the declaration that appears last in the stylesheet.
  Michel Crampes           Cours XSLT et Xpath                       Septembre 2002




                   User-defined Data Elements
In addition to declarations, the xsl:stylesheet element may contain any element not
from the XSLT namespace, provided that the expanded-QName of the element has a
non-null namespace URI. Such elements are referred to as user-defined data elements.
[ERR011] It is a static error if the xsl:stylesheet element has a child element having a
null namespace URI.
An implementation may attach meaning to user-defined data elements that appear in a
namespace controlled by the vendor. The presence of a user-defined data element must
not change the behavior of XSLT elements and functions defined in this document; for
example, it is not permitted for a user-defined data element to specify that xsl:apply-
templates should use different rules to resolve conflicts. Thus, an implementation is
always free to ignore user-defined data elements, and must ignore such data elements
without giving an error if it does not recognize the namespace URI. The set of
namespaces that are recognized for such data elements is implementation-defined.
User-defined data elements can provide, for example,
    information used by extension instructions or extension functions (see [18
       Extensibility and Fallback]),
    information about what to do with the result tree,
    information about how to obtain the source tree,
    optimization hints for the processor,
    metadata about the stylesheet,
    structured documentation for the stylesheet.
[ERR012] A user-defined data element must not precede an xsl:import element within a
stylesheet module.

Literal result elements (from [saxon2001])
Any elements in the style sheet other than those listed above are assumed to be literal
result elements, and are copied to the current output stream at the position in which they
occur.
Attribute values within literal result elements are treated as attribute value templates:
they may contain string expressions enclosed between curly braces. For the syntax of
string expressions, see xsl:value-of above.
  Michel Crampes           Cours XSLT et Xpath                       Septembre 2002




     Utiliser ‘template match’ ... ‘value-of
     select’ et génération d’un document
                    HTML
Exemple style1 (figure 5):
<?xml version = '1.0' encoding='ISO-8859-1' ?>
<!-- starsxsl1.xsl, aout 2002, auteur : Michel Crampes -->
<xsl:stylesheet version= '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match='/'>
     <html><body>
          <h1> Bibliographie des stars </h1>
          <h2> par Marcel Dugoumier</h2>
          <hr SIZE='3' WIDTH="1000"/>
          <p> <xsl:value-of select = "."/> </p>
          <h1> <xsl:value-of select = "//prenom"/> </h1>
          <h1> <xsl:value-of select = "//succes"/> </h1>
     </body></html>
</xsl:template>
</xsl:stylesheet>

Résultat (sous Internet Explorer 5.5)
Bibliographie des stars
par Marcel Dugoumier

Connu pour son attitude 'rock n'roll, Johnny Haliday est un chanteur de rock . Parmi ses
nombreux succès, on compte des titres comme allumer le feu , l'idole des jeunes , ou encore
, Gabrielle . Ses aventures amoureuses nombreuses (Sylvie Vartan , Nathalie Bayle , etc. )
font de lui un abonné des revues 'people'. Dugoumier Marcel est sans nul doute le meilleur,
mais aussi le plus méconnu des chanteurs de rock. Parmi ses nombreux succès, on compte
en particulier 'Le tube de Marcel' Vartan Sylvie La femme de Johnny dans les années 60.

Johnny
allumer le feu
  Michel Crampes            Cours XSLT et Xpath                       Septembre 2002




                   Utiliser apply-templates
Exemple style2 :
<?xml version = '1.0'?>
<xsl:stylesheet version= '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match='/'>
     <html>
     <body>
     <xsl:apply-templates select='//nom'/>
          <p> <xsl:value-of select = "."/> </p>
          <h1> <xsl:value-of select = "//prenom"/> </h1>
     </body>
     </html>
</xsl:template>

<xsl:template match='nom'>
<p> <xsl:value-of select = "."/> </p>
</xsl:template>
</xsl:stylesheet>


Résultat :
Haliday
Dugoumier
Johny Haliday Connu pour son attitude 'rock n'roll, Johnny Haliday est un chanteur de
rock . allumer le feu , l'idole des jeunes , ou encore , Gabrielle . Ses aventures
amoureuses nombreuses (Sylvie Vartan , Nathalie Bayle , etc. ) font de lui un abonne
des revues 'people'. Marcel Dugoumier Marcel Dugoumier

Johnny
_____________________________________
Application :
créer une feuille de style qui ne fait plus apparaître le texte de description de l’élément
stars et qui liste les succès pour chacune des stars

 « A template rule that is selected to process a particular node in the source tree will
generally write one or more nodes to the result tree, and will frequently use the
xsl:apply-templates instruction to select other nodes in the source tree (often, but not
invariably, the original node's children) for processing. Each of these selected nodes is
processed by searching the stylesheet for a matching template rule. »
  Michel Crampes        Cours XSLT et Xpath   Septembre 2002




                     Utiliser apply-templates
Exemple style3
<?xml version = '1.0'?>
<xsl:stylesheet version= '1.0'
    xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match='/'>
    <html> <body>
    <xsl:apply-templates select ='//star'/>
    </body> </html>
</xsl:template>

<xsl:template match='star'>
    <xsl:apply-templates select='nom'/>
    <xsl:apply-templates select='succes'/>
</xsl:template>

<xsl:template match='nom'>
    nom : <h1> <xsl:value-of select = "."/> </h1>
</xsl:template>

<xsl:template match='succes'>
    <xsl:value-of select = "."/>,
</xsl:template>

</xsl:stylesheet>

Résultat :
nom :

Haliday
allumer le feu
l'idole des jeunes
Gabrielle
nom :

Dugoumier
le tube de Marcel
  Michel Crampes          Cours XSLT et Xpath                     Septembre 2002




                                Les boucles
xsl:for-each
Category: instruction
Model:
      <xsl:for-each
         select = sequence-expression>
         <!-- Content: (xsl:sort*, content-constructor) -->
        </xsl:for-each>
Permitted parent elements:
            any XSLT element whose content model is content constructor
            any literal result element

xsl:for-each-group
Category: instruction
Model:
      <xsl:for-each-group
         select = expression
         group-by = expression
         group-adjacent = expression
         group-starting-with = pattern
         group-ending-with = pattern
         collation = { uri }
         type = qname>
         <!-- Content: (xsl:sort*, content-constructor) -->
        </xsl:for-each-group>
Permitted parent elements:
            any XSLT element whose content model is content constructor
            any literal result element



           Les chemins Xpath (détails XPath en annexe)
« Instructions that select nodes from the source document, or that derive information
from these nodes for inclusion in the result document, always access the source tree by
means of an Expression in the XPath language, described in [XPath 2.0]. A stylesheet
written to use XSLT 2.0 will contain expressions whose syntax and semantics are defined
by XPath 2.0 (but see also [3.6 Backwards-Compatible Processing] and [3.7 Forwards-
Compatible Processing]). »
   Michel Crampes              Cours XSLT et Xpath                             Septembre 2002




 Exemples Xpath, for each, name ( )
Bibliographie des stars, par Marcel Dugoumier

Johnny
succes : allumer le feu
succes : l'idole des jeunes
succes : Gabrielle
Marcel
succes : 'Le tube de Marcel'
Sylvie
                                                              Exercice :
succes :
                                                              Trouver ci-dessous comment
                                                              obtenir ce rendu .
<?xml version = '1.0' encoding='ISO-8859-1' ?>
<!-- starsxsl02.xsl, auteur : Crampes, Aout 2002 -->
<!-- Exemple de l'extraction de valeurs d'éléments selon différents chemins XPath-->
<xsl:stylesheet version= '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
        xmlns:xf='http://www.w3.org/2002/08/xquery-functions '>

       <xsl:template match='/'>
               <html> <body>
               <h2> Bibliographie des stars, par Marcel Dugoumier</h2>
               <hr SIZE='3' WIDTH="1000"/>
               <xsl:apply-templates/>
               </body></html>
       </xsl:template>

<!--    <xsl:template match='star'>
               <h1> <xsl:value-of select = "prenom"/> </h1>
               <!-- Essayer, observer, expliquer::      -->
               <!-- <xsl:for-each select="//succes">    -->
               <!-- <xsl:for-each select="/succes">     -->
               <!-- <xsl:for-each select="./succes">    -->
               <!-- <xsl:for-each select=".//succes"> -->
               <!-- <xsl:for-each select="*">           -->
               <!-- <xsl:for-each select="/*">          -->
               <!-- <xsl:for-each select="//*">         -->
               <h2><xsl:value-of select = '.'/> </h2>
               </xsl:for-each>
</xsl:template> -->
</xsl:stylesheet>
  Michel Crampes           Cours XSLT et Xpath                       Septembre 2002




      Utiliser apply-templates imbriquées
<?xml version = '1.0'?>
<!—starsxsl03.xsl,   septembre 2002, auteur : Michel Crampes       -->
<xsl:stylesheet version= '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
     xmlns:xf='http://www.w3.org/2002/08/xquery-functions '>

 <xsl:template match='stars'>
     <html> <body>
     <xsl:apply-templates/>
     </body></html>
</xsl:template>

<xsl:template match='star'>
     <h1> <xsl:value-of select = "prenom"/> </h1>
     <h1> succès : </h1>
     <!-- Essayer les différentes solutions suivantes                         -->
     <!-- <h1> <xsl:value-of select = "succes"/> </h1>                        -->
     <!-- <h1> <xsl:value-of select = ".//succes"/> </h1>                     -->
     <!-- <xsl:apply-templates select='succes'/>                              -->
     <!-- <xsl:apply-templates select='.//succes'/>                           -->
</xsl:template>

<xsl:template match='succes'>
     <h2> <xsl:value-of select = "."/> </h2>
</xsl:template>
</xsl:stylesheet>


« Sometimes all the selected nodes will be processed by the same template rule, but in
general different nodes will be processed by different template rules. Either way, the
chosen template rules are evaluated and the process repeats itself, typically resulting in
a recursive traversal of the source tree. »
  Michel Crampes          Cours XSLT et Xpath                   Septembre 2002




                     Application de ‘modes’
Exercice :
Imaginer ce que produit la FS suivante :
<?xml version = '1.0' encoding='ISO-8859-1' ?>
<!—starsxsl04.xsl,   septembre 2002, auteur : Michel Crampes   -->
<xsl:stylesheet version= '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
     xmlns:xf='http://www.w3.org/2002/08/xquery-functions '>

 <xsl:template match='stars'>
     <html> <body>
     <xsl:apply-templates mode = 'toc'/>
     <h1> Sommaire des stars : </h1>
     <xsl:apply-templates mode = 'tic'/>
     </body></html>
</xsl:template>

<xsl:template match='star' mode = 'toc'>
     <h2> <xsl:value-of select = "prenom"/> </h2>
     <h2> succès :
     <xsl:apply-templates select='.//succes'/></h2>
</xsl:template>

<xsl:template match='star' mode = 'tic'>
     <xsl:apply-templates select='nom'/>
</xsl:template>

<xsl:template match='succes'>
     <h3> <xsl:value-of select = "."/> </h3>
</xsl:template>

<xsl:template match='nom'>
     <h2> <xsl:value-of select = "."/> </h2>
</xsl:template>

</xsl:stylesheet>
  Michel Crampes          Cours XSLT et Xpath                    Septembre 2002




                   Ordonner l’information
Dans l‟exemple précédent, remplacer,
      <xsl:apply-templates mode = 'tic'/>
par
      <xsl:apply-templates mode = 'tic'>
           <xsl:sort select = './/nom'/>
      </xsl:apply-templates>
puis par
      <xsl:apply-templates mode = 'tic'>
           <xsl:sort select = './/nom' order='descending'/>
      </xsl:apply-templates>

Syntaxe de Apply-templates
Category: instruction
      <xsl:apply-templates
         select = node-sequence-expression
         mode = token>
         <!-- Content: (xsl:sort | xsl:with-param)* -->
        </xsl:apply-templates>
Permitted parent elements:
            any XSLT element whose content model is content constructor
            any literal result element

Syntaxe de Apply-templates xsl:sort
        <xsl:sort
         select = expression
         lang = { nmtoken }
         type = { qname }
         order = { "ascending" | "descending" }
         collation = { uri }
         case-order = { "upper-first" | "lower-first" }
         data-type = { "text" | "number" | qname-but-not-ncname } />
Permitted parent elements:
      xsl:sort-key
      xsl:for-each
      xsl:apply-templates
      xsl:for-each-group
  Michel Crampes      Cours XSLT et Xpath     Septembre 2002




           Extraire la valeur d’un attribut
Exemple Style4 :
<?xml version = '1.0'?>
<xsl:stylesheet version= '1.0'
    xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match='/'>
    <html><body>
    <xsl:apply-templates select ='//star'/>
    </body></html>
</xsl:template>

<xsl:template match='star'>
    <xsl:apply-templates select='nom'/>
    <xsl:value-of select = "@age"/> <br/>
    succes : <xsl:apply-templates select='succes'/> <br/>
</xsl:template>
<xsl:template match='nom'>
<i> nom: </i><b> <xsl:value-of select = "."/> </b>
</xsl:template>
</xsl:stylesheet>

Résultat
nom: Haliday 54 ans
nom: Dugoumier
  Michel Crampes          Cours XSLT et Xpath          Septembre 2002



Synthèse 1 : réorganiser et présenter un document XML
<?xml version = '1.0' encoding='ISO-8859-1' ?>
<!-- starsxsl5.xsl, septembre 2002, auteur : Michel Crampes             -->
<xsl:stylesheet version= '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match='stars'>
     <html><body>
      <h2> Bibliographie des stars, par Marcel Dugoumier</h2>
     <hr SIZE='3' WIDTH="1000"/>
     <xsl:apply-templates mode = 'tic'/>
     <h2> Sommaire des stars : </h2>
     <xsl:apply-templates mode = 'toc'>
          <xsl:sort select = './/nom'/>
     </xsl:apply-templates>
     </body></html>
</xsl:template>

<xsl:template match='star' mode='tic'>
     <i>IDENTITE: </i> <xsl:value-of select = "@ID"/> <br/>
     <xsl:apply-templates select='nom'/>
     <i>profession: </i> <xsl:value-of select = "profession"/><br/>
     age: <xsl:value-of select="@age"/><br/>
     succès : <xsl:apply-templates select='.//succes'/> <br/>
     agent: <xsl:value-of select="@agent"/><br/>
     ses amours : <xsl:apply-templates select='relation_amoureuse'/>
<br/>
     <br/><xsl:value-of select = "."/>
     <hr SIZE='1' WIDTH="1000"/>
</xsl:template>

<xsl:template match='star' mode = 'toc'>
     <xsl:apply-templates select='nom' mode ='toc'/>
</xsl:template>

<xsl:template match='nom'>
     <h4> <i>nom: </i> <xsl:value-of select = "."/> <br/>
     <i>prénom: </i> <xsl:value-of select = "../prenom"/> </h4>
  </xsl:template>

<xsl:template match='nom' mode = 'toc'>
     <h5> <xsl:value-of select = "../prenom"/> <xsl:value-of select=
"."/></h5>
  </xsl:template>

<xsl:template match='succes'>
     <xsl:value-of select = "."/> ,
</xsl:template></xsl:stylesheet>
Voir le rendu page suivante
   Michel Crampes                Cours XSLT et Xpath                           Septembre 2002



Bibliographie des stars, par Marcel Dugoumier (starsxsl5.xsl)
IDENTITE: Johny Haliday
nom: Haliday
prénom: Johnny
profession: chanteur de rock
age: 54
succès : allumer le feu , l'idole des jeunes , Gabrielle ,
agent: Picsou
ses amours : Sylvie Vartan Nathalie Bayle

Connu pour son attitude 'rock n'roll, Johnny Haliday est un chanteur de rock . Parmi ses nombreux
succès, on compte des titres comme allumer le feu , l'idole des jeunes , ou encore , Gabrielle . Ses
aventures amoureuses nombreuses (Sylvie Vartan , Nathalie Bayle , etc. ) font de lui un abonné des
revues 'people'.

IDENTITE: Marcel Dugoumier
nom: Dugoumier
prénom: Marcel
profession:
age: 68
succès : 'Le tube de Marcel' ,
agent: Dugoumier
ses amours :

Dugoumier Marcel est sans nul doute le meilleur, mais aussi le plus méconnu des chanteurs de rock.
Parmi ses nombreux succès, on compte en particulier 'Le tube de Marcel'

IDENTITE: Sylcie Vartan
nom: Vartan
prénom: Sylvie
profession:
age: caché
succès : ,
agent: Picsou
ses amours :

Vartan Sylvie La femme de Johnny dans les années 60.


Sommaire des stars :
Marcel Dugoumier
Johnny Haliday
Sylvie Vartan
  Michel Crampes           Cours XSLT et Xpath                        Septembre 2002




                           Conflits de règles
« In the process of finding a template rule to process a particular node, more than one
template rule may have a pattern that matches the node. However, only one template
rule will be applied. The method for deciding which template rule to apply is described
in [6.3 Conflict Resolution for Template Rules]. If there is no template rule that
matches the node, a built-in template rule is used (see [6.5 Built-in Template Rules]). »

1) First, all matching template rules that have lower import precedence than the
matching template rule or rules with the highest import precedence are eliminated from
consideration.
2) Next, all matching template rules that have lower priority than the matching template
rule or rules with the highest priority are eliminated from consideration. The priority of a
template rule is specified by the priority attribute on the template rule. [ERR044] The
value of this must be a real number (positive or negative), matching the production
NumericLiteral with an optional leading minus sign (-). [ERR045] If an xsl:template
element does not have a match attribute, then it must not have a priority attribute.
If no priority attribute is specified on the xsl:template element, the default priority is
computed as follows:
     If the pattern contains multiple alternatives separated by |, then it is treated
       equivalently to a set of template rules, one for each alternative. Note, however,
       that it is not an error if a node matches more than one of the alternatives.
     If the pattern has the form of a QName optionally preceded by a PatternAxis or
       has the form processing-instruction(StringLiteral) optionally preceded by a
       PatternAxis, then the priority is 0.
     If the pattern has the form NCName:* or *:NCName, optionally preceded by a
       PatternAxis, then the priority is -0.25.
     Otherwise, if the pattern consists of just a NodeTest optionally preceded by a
       PatternAxis, then the priority is -0.5.
     Otherwise, the priority is 0.5.
  Michel Crampes           Cours XSLT et Xpath                       Septembre 2002




                       Template overriding
A template rule that is being used to override a template rule in an imported stylesheet
(see [6.3 Conflict Resolution for Template Rules]) can use the xsl:apply-imports
element to invoke the overridden template rule.

xsl:apply-templates
Category: instruction
Model:
      <xsl:apply-templates
         select = node-sequence-expression
         mode = token>
         <!-- Content: (xsl:sort | xsl:with-param)* -->
        </xsl:apply-templates>
Permitted parent elements:
            any XSLT element whose content model is content constructor
            any literal result element
  Michel Crampes           Cours XSLT et Xpath                      Septembre 2002




                          Règles par défaut
When a node is selected by xsl:apply-templates and there is no template rule in the
stylesheet that can be used to process that node, a built-in template rule is evaluated
instead. The built-in template rule for document nodes and elements nodes causes the
children of the node to be processed; the built in rule for text nodes and attribute nodes
causes the text to be copied to the result tree.
The built-in template rules apply to all modes. It is not possible for a user-written
template rule to apply to all modes, but for the sake of illustration, the syntax
mode="#all" is used in the examples below as shorthand for a list of all modes (including
the default mode) that are used in the stylesheet.
The built-in rule for document nodes and element nodes is equivalent to calling
xsl:apply-templates with no select attribute, and with the mode attribute set to #current.
If the built-in rule was invoked with parameters, those parameters are passed on in the
implicit xsl:apply-templates instruction.



                              Réutilisabilité
« Because the template rule that is written to process one node in the tree has no
knowledge of which rules will be chosen to process the nodes that it selects, push
processing allows a stylesheet to be applicable to a wide class of documents that have
similar source tree structures. »
  Michel Crampes            Cours XSLT et Xpath                       Septembre 2002




                        Stylesheet Inclusion
Category: declaration
Model:
      <xsl:include
         href = uri-reference />
Permitted parent elements:
            xsl:stylesheet
            xsl:transform

« A stylesheet module may include another stylesheet module using an xsl:include
declaration. The xsl:include declaration has an href attribute whose value is a URI
reference identifying the stylesheet module to be included. A relative URI is resolved
relative to the base URI of the xsl:include declaration (see [Data Model]). »
The included stylesheet module may be either a standard stylesheet module or a a
simplified stylesheet module. It may be a complete XML document, or (if referenced
using a suitable fragment identifier) it may be an embedded stylesheet module.
[ERR016] The xsl:include element is allowed only as a top-level element.
A stylesheet level is a collection of stylesheet modules connected using xsl:include
declarations: specifically, two stylesheet modules A and B are part of the same stylesheet
level if one of them includes the other by means of an xsl:include declaration, or if there
is a third stylesheet module C that is in the same stylesheet level as both A and B.
The declarations within a stylesheet level have a total ordering known as declaration
order. The order of declarations within a stylesheet level is the same as the document
order that would result if each stylesheet module were inserted textually in place of the
xsl:include element that references it. In other respects, however, the effect of
xsl:include is not equivalent to the effect that would be obtained by textual inclusion.
[ERR017] It is an static error if a stylesheet module directly or indirectly includes itself.
  Michel Crampes           Cours XSLT et Xpath                       Septembre 2002




                          Stylesheet Import
A stylesheet module may import another stylesheet module using an xsl:import
declaration.

xsl:import
Category: declaration
      <xsl:import
         href = uri-reference />
Permitted parent elements:
            xsl:stylesheet
            xsl:transform

Importing a stylesheet is the same as including it (see [3.8.1 Stylesheet Inclusion])
except that template rules and other declarations in the importing stylesheet take
precedence over template rules and declarations in the imported stylesheet; this is
described in more detail below. The xsl:import declaration has an href attribute whose
value is a URI reference identifying the stylesheet to be imported. A relative URI is
resolved relative to the base URI of the xsl:import element (see [Data Model]).
It is implementation-defined whether the URI reference may include a fragment
identifier, and if so, what form of fragment identifier is supported. A future version of
XSLT may define rules for the use of fragment identifiers in the URI reference, for
example by reference to the XPointer specification (see [XPointer]). Note that if the
implementation does not support the use of fragment identifiers in the URI reference,
then it will not be possible to import an embedded stylesheet module.

Règles de préséance
For example, suppose
    stylesheet module A imports stylesheet modules B and C in that order;
    stylesheet module B imports stylesheet module D;
    stylesheet module C imports stylesheet module E.
Then the import tree has the following structure:
         A
         |
     +---+---+
     |       |
     B       C
     |       |
     D       E
The order of import precedence (lowest first) is D, B, E, C, A.
In general, a declaration with higher import precedence takes precedence over a
declaration with lower import precedence. This is defined in detail for each kind of
declaration.
  Michel Crampes              Cours XSLT et Xpath                             Septembre 2002




             Embedded Stylesheet Modules
A standard stylesheet module is a complete XML document with the xsl:stylesheet
element as its document element. However, a stylesheet module may also be embedded
in another resource. Two forms of embedding are possible:
     the XSLT stylesheet may be textually embedded in a non-XML resource, or
     the xsl:stylesheet element may occur in an XML document other than as the
      document element.
To facilitate the second form of embedding, the xsl:stylesheet element is allowed to
have an ID attribute that specifies a unique identifier.
   NOTE: In order for such an attribute to be used with the XPath id function, it must actually be
   declared in the DTD or schema as being of type ID. The same requirement typically applies if
   the identifier is to be used as a fragment identifier in a URI reference.
The following example shows how the xml-stylesheet processing instruction (see [XML
Stylesheet]) can be used to allow a source document to contain its own stylesheet. The
URI reference uses a relative URI with a fragment identifier to locate the xsl:stylesheet
element:
<?xml-stylesheet type="text/xml" href="#style1"?>
<!DOCTYPE doc SYSTEM "doc.dtd">
<doc>
<head>
<xsl:stylesheet id="style1"
                version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:import href="doc.xsl"/>
<xsl:template match="id('foo')">
  <fo:block font-weight="bold"><xsl:apply-templates/></fo:block>
</xsl:template>
<xsl:template match="xsl:stylesheet">
  <!-- ignore -->
</xsl:template>
</xsl:stylesheet>
</head>
<body>
<para id="foo">
...
</para>
</body>
</doc>
   NOTE: A stylesheet module that is embedded in the document to which it is to be applied or
   that may be included or imported into a stylesheet that is so embedded typically needs to
   contain a template rule that specifies that xsl:stylesheet elements are to be ignored.
  Michel Crampes          Cours XSLT et Xpath                  Septembre 2002




                    Règles conditionnelles
xsl:if
Category: instruction
Model:
      <xsl:if
         test = expression>
         <!-- Content: content-constructor -->
        </xsl:if>
Permitted parent elements:
      any XSLT element whose content model is content constructor
     any literal result element

xsl:choose
Category: instruction
Model:
      <xsl:choose>
         <!-- Content: (xsl:when+, xsl:otherwise?) -->
        </xsl:choose>
Permitted parent elements:
            any XSLT element whose content model is content constructor
xsl:when
Model:
        <xsl:when
         test = expression>
         <!-- Content: content-constructor -->
        </xsl:when>
Permitted parent elements:
           xsl:choose

xsl:otherwise
Model:
        <xsl:otherwise>
         <!-- Content: content-constructor -->
        </xsl:otherwise>
Permitted parent elements:
           xsl:choose
  Michel Crampes           Cours XSLT et Xpath                      Septembre 2002




         Reonstruire des documents XML
                       (1 : par copies de l’arbre d’entrée) (1/2)

Il est possible de reconstruire un document XML à partir d‟une FS appliquée à un
document XML d‟entré.

Recopie de noeuds et de sous-arbres
xsl:copy
Category: instruction
Model:
        <xsl:copy
         use-attribute-sets = qnames>
         <!-- Content: content-constructor -->
        </xsl:copy>
Permitted parent elements:
            any XSLT element whose content model is content constructor
            any literal result element

Extrait de Saxon :
The xsl:copy element causes the current XML node in the source document to be copied
to the output. The actual effect depends on whether the node is an element, an attribute,
or a text node.
For an element, the start and end element tags are copied; the attributes, character
content and child elements are copied only if xsl:apply-templates is used within
xsl:copy.
Attributes of the generated element can be defined by reference to a named attribute set.
The optional use-attribute-sets attribute contains a white-space-separated list of
attribute set names. They are applied in the order given: if the same attribute is
generated more than once, the later value always takes precedence.
The following example is a template that copies the input element to the output, together
with all its child elements, character content, and attributes:
<xsl:template match="*|text()|@*">
    <xsl:copy>
        <xsl:apply-templates select="@*"/>
        <xsl:apply-templates/>
    </xsl:copy>
</xsl:template>
  Michel Crampes           Cours XSLT et Xpath                        Septembre 2002




        Reconstruire des documents XML
                        (1 : par copies de l’arbre d’entrée) (2/2)
xsl:copy-of
Category: instruction
Model:
        <xsl:copy-of
         select = expression
         separator = { string }
         copy-type-annotations = "yes" | "no" />
Permitted parent elements:
            any XSLT element whose content model is content constructor
            any literal result element

Extrait de Saxon
The xsl:copy-of element copies of the value of the expression in the mandatory select
attribute to the result tree
If this expression is a string, a number, or a boolean, the effect is the same as using
xsl:value-of. It is usually used where the value is a nodeset or a result tree fragment.

Exercice :
Tronquer le document XML suivant selon différents scénarios
<?xml version = "1.0" encoding='ISO-8859-1' ?>
<?xml-stylesheet type = "text/xsl" href = "starstextxsl.xsl" ?>
<stars>
<star>
        <chanteur>
                <chanteur_rock>
                        Liste des chanteurs de rock
                        <instance sexe='masculin'>
                                  Johnny
                        </instance>
                        <instance sexe='masculin'>
                                  Eddy
                        </instance>
                </chanteur_rock>
                <chanteur_soupe>
                        Liste des chanteurs 'soap'
                        <instance sexe='feminin'>
                                  Sylvie
                        </instance>
                        <instance sexe='masculin'>
                                  Dave
                        </instance>
                </chanteur_soupe>
        </chanteur>
</star>
<contenu> Le texte </contenu>
</stars>
  Michel Crampes           Cours XSLT et Xpath                 Septembre 2002




        Reconstruire des documents XML
                                (2 : éléments et attributs)
xsl:element
Category: instruction
      <xsl:element
         name = { qname }
         namespace = { uri-reference }
         use-attribute-sets = qnames
         type-annotation = qname>
         <!-- Content: content-constructor -->
        </xsl:element>
Permitted parent elements:
            any XSLT element whose content model is content constructor
            any literal result element

xsl:attribute
Category: instruction
      <xsl:attribute
         name = { qname }
         namespace = { uri-reference }
         type-annotation = qname
         disable-output-escaping = "yes" | "no">
         <!-- Content: content-constructor -->
        </xsl:attribute>
Permitted parent elements:
            xsl:attribute-set
            any XSLT element whose content model is content constructor
            any literal result element

xsl:attribute-set
Category: declaration
      <xsl:attribute-set
         name = qname
         use-attribute-sets = qnames>
         <!-- Content: xsl:attribute* -->
        </xsl:attribute-set>
Permitted parent elements:
            xsl:stylesheet
            xsl:transform
  Michel Crampes         Cours XSLT et Xpath                   Septembre 2002




                   Construire des entités XML
                       (3:Processing instructions, comments)
xsl:processing-instruction
Category: instruction
Model:
        <xsl:processing-instruction
         name = { ncname }>
         <!-- Content: content-constructor -->
        </xsl:processing-instruction>
Permitted parent elements:
           any XSLT element whose content model is content constructor
           any literal result element

xsl:comment
Category: instruction
Model:
      <xsl:comment>
         <!-- Content: content-constructor -->
        </xsl:comment>
Permitted parent elements:
            any XSLT element whose content model is content constructor
            any literal result element
Exemple
<xsl:comment>This file is automatically generated. Do not edit!</xsl:comment>
would create the comment
<!--This file is automatically generated. Do not edit!-->
  Michel Crampes            Cours XSLT et Xpath                       Septembre 2002




                   Construire des entités XML
                                (4 :Text nodes, comments)
Text nodes
A content constructor can also contain text nodes. Each text node in a content
constructor remaining after whitespace has been stripped as specified in [4.4
Whitespace Stripping] will construct a text node with the same string-value. The
resulting text node is added to the result of the containing content constructor. When the
resulting content is added to a result tree, adjacent text nodes in the result tree are
automatically merged.
Note that text is processed at the tree level. Thus, markup of &lt; in a template will be
represented in the stylesheet tree by a text node that includes the character <. This will
create a text node in the result tree that contains a < character, which will be represented
by the markup &lt; (or an equivalent character reference) when the result tree is
externalized as an XML document (unless output escaping is disabled as described in
[20.5 Disabling Output Escaping]).
Category: instruction
Model:
         <xsl:text
          disable-output-escaping = "yes" | "no">
          <!-- Content: content-constructor -->
         </xsl:text>
Permitted parent elements:
            any XSLT element whose content model is content constructor
            any literal result element
  Michel Crampes          Cours XSLT et Xpath                     Septembre 2002




                   Creating Namespace Nodes
                                    (5 : Namespaces)
xsl:namespace
Category: instruction
Model:
        <xsl:namespace
         name = { ncname }>
         <!-- Content: content-constructor -->
        </xsl:namespace>
Permitted parent elements:
           any XSLT element whose content model is content constructor
           any literal result element

xsl:namespace-alias
Category: declaration
Model:
         <xsl:namespace-alias
           stylesheet-prefix = prefix | "#default"
           result-prefix = prefix | "#default" />
Permitted parent elements:
             xsl:stylesheet
             xsl:transform
The xsl:namespace element is evaluated to create a namespace node. The content of the
xsl:namespace element is a content constructor for the string-value of the namespace
node (that is, the namespace URI). The xsl:namespace element has a required name
attribute that specifies the name of the namespace node (that is, the namespace prefix).
The value of the name attribute is interpreted as an attribute value template.
Except in error situations, the result of evaluating the xsl:namespace instruction is a
single node, the newly constructed namespace node. Note the restrictions described in
[5.6 Content Constructors] for the position of a namespace node relative to other nodes
in the node sequence returned by a content constructor.
For example, this
<xsl:namespace name="xsd">http://www.w3.org/2001/XMLSchema</xsl:namespace>
would typically cause the output document to contain the namespace declaration:
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  Michel Crampes           Cours XSLT et Xpath                      Septembre 2002




                                   Grouping
Exemple :
The following example groups a list of nodes based on common values. The resulting
groups are numbered but unsorted, and a total is calculated for each group.
Source XML document:
<cities>
  <city name="Milano"    country="Italia"        pop="5"/>
  <city name="Paris"     country="France"        pop="7"/>
  <city name="München"   country="Deutschland"   pop="4"/>
  <city name="Lyon"      country="France"        pop="2"/>
  <city name="Venezia"   country="Italia"        pop="1"/>
</cities>
More specifically, the aim is to produce a four-column table, containing one row for
each distinct country. The four columns are to contain first, a sequence number giving
the number of the row; second, the name of the country, third, a comma-separated
alphabetical list of the city names within that country, and fourth, the sum of the pop
attribute for the cities in that country.
Desired output:
<table>
  <tr>
    <th>Position</th>
    <th>Country</th>
    <th>List of Cities</th>
    <th>Population</th>
  </tr>
  <tr>
    <td>1</td>
    <td>Italia</td>
    <td>Milano, Venezia</td>
    <td>6</td>
  </tr>
  <tr>
    <td>2</td>
    <td>France</td>
    <td>Lyon, Paris</td>
    <td>9</td>
  </tr>
  <tr>
    <td>3</td>
    <td>Deutschland</td>
    <td>München</td>
    <td>4</td>
  </tr>
</table>
  Michel Crampes           Cours XSLT et Xpath                       Septembre 2002




                           Grouping (suite)
Solution:
<table xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <tr>
    <th>Position</th>
    <th>Country</th>
    <th>City List</th>
    <th>Population</th>
  </tr>
  <xsl:for-each-group select="cities/city" group-by="@country">
    <tr>
       <td><xsl:value-of select="position()"/></td>
       <td><xsl:value-of select="@country"/></td>
       <td>
         <xsl:value-of select="current-group()/@name" separator=","/>
       </td>
       <td><xsl:value-of select="sum(current-group()/@pop)"/></td>
    </tr>
  </xsl:for-each-group>
</table>



Objectif :
« to group nodes in a document based on common string values, common names, or
commmon values for any other expression. Since grouping identifies items with
duplicate values, the same facilities also allow selection of the distinct values in a
sequence of items, that is, the elimination of duplicates.
In addition these facilities allow grouping based on sequential position, e.g. selecting
groups of adjacent PARA elements. The facilities also provide an easy way to do fixed-size
grouping, for example identifying groups of three adjacent nodes, which is useful when
arranging data in multiple columns.
For each group of items identified, it is possible to evaluate a content constructor for the
group. Grouping is nestable to multiple levels so that groups of distinct items can be
identified, then from among the distinct groups selected, further sub-grouping of distinct
items in the current group can be done. »
   Michel Crampes                   Cours XSLT et Xpath            Septembre 2002




                                          Extensibility
« XSLT provides two hooks for extending the language, one hook for extending the set of
instruction elements used in content constructors and one hook for extending the set of
functions used in XPath expressions. These hooks are both based on XML namespaces:
see [18 Extensibility and Fallback] for further details. Extension instructions and
extension functions defined according to these rules may be provided by the
implementor of the XSLT processor, and the implementor may also provide facilities to
allow users to create further extension instructions and extension functions. This
specification defines how extension instructions and extension functions are invoked, but
the facilities for creating new extension instructions and extension functions are
implementation-defined »


                         Stylesheets and Schemas
« An XSLT stylesheet can make use of information from XML Schemas, as defined in
[XML Schema]. An XSLT transformation can take place in the absence of a schema
(and, indeed, in the absence of a DTD), but where the source document has undergone
schema validity assessment, the XSLT processor has access to the type information
associated with individual nodes, not merely to the raw text.
There are places within a stylesheet, and within XPath expressions and patterns with a
stylesheet, where the names of schema-defined elements, attributes, and named types
may appear. For example, it is possible to declare the types expected for the parameters
of a function. The element, attribute, and type names that appear in such contexts must
either be built-in schema types (for example xs:string or xs:integer), or they must be
user-defined types that are made accessible to the XSLT processor by means of an
xsl:import-schema declaration: see [3.10 Importing Schema Components].
It is only necessary to import a schema explicitly if its type definitions are mentioned
statically in the stylesheet; it is not necessary to import a schema merely because the
stylesheet is used to process a source document that has been assessed against that
schema. It is possible to make use of the information resulting from schema assessment
(for example, the fact that a particular attribute holds a date) even if no schema has
been imported by the stylesheet »

xsl:import-schema
Category: declaration
        <xsl:import-schema
         namespace = uri-reference
         schema-location = uri-reference />
Permitted parent elements:
                 xsl:stylesheet
                 xsl:transform
  Michel Crampes           Cours XSLT et Xpath                      Septembre 2002




                                    Messages
xsl:message
Category: instruction
Model:
        <xsl:message
         terminate = { "yes" | "no" }>
         <!-- Content: content-constructor -->
        </xsl:message>
Permitted parent elements:
            any XSLT element whose content model is content constructor
            any literal result element
            xsl:function

For example, the following code might be used to indicate to a particular
implementation that the xsl:message instruction is to ask the user for confirmation before
continuing with the transformation:
<xsl:message
    abc:pause="yes"
    xmlns:abc="http://vendor.example.com/xslt/extensions">Phase 1
complete</xsl:message>
Implementations that do not recognize the namespace
http://vendor.example.com/xslt/extensions will simply ignore the extra attribute, and
evaluate the xsl:message instruction in the normal way.
  Michel Crampes          Cours XSLT et Xpath      Septembre 2002




                                    XPath
Extrait de

XML Path Language (XPath) 2.0
W3C Working Draft 16 August 2002
This version:
   http://www.w3.org/TR/2002/WD-xpath20-20020816



Michel Crampes
Ecole des Mines d‟Ales
Janvier_Mars ... Septembre 2002



Voir aussi dans Saxon
   Michel Crampes           Cours XSLT et Xpath                       Septembre 2002




                            Path Expressions
A path expression can be used to locate nodes within a tree. Because the XPath
grammar is organized around the precedence of operators, the syntax for PathExpr also
includes PrimaryExpr. In common usage, the term path expression denotes a PathExpr
that is not simply a PrimaryExpr.
                               ("/" RelativePathExpr?) | ("//" RelativePathExpr)
[18] PathExpr             ::= | RelativePathExpr
[19] RelativePathExpr ::= StepExpr (("/" | "//") StepExpr)*
A path expression consists of a series of one or more steps, separated by "/", and
optionally beginning with "/" or "//". An initial "/" or "//" is an abbreviation for one or
more initial steps that are implicitly added to the beginning of the path expression, as
described below.

.../...
Forme abbrégée :
As an example of a path expression, child::div1/child::para selects the para element
children of the div1 element children of the context node, or, in other words, the para
element grandchildren of the context node that have div1 parents.
A "/" at the beginning of a path expression is an abbreviation for the initial step
xf:root(self::node()). The effect of this initial step is to begin the path at the root node
that contains the context node. If the context item is not a node, a dynamic error is
raised.
A "//" at the beginning of a path expression is an abbreviation for the initial steps
xf:root(self::node())/descendant-or-self:node(). The effect of these initial steps is to
establish an initial node sequence that contains all nodes in the same hierarchy as the
context node. This node sequence is then filtered by subsequent steps in the path
expression. If the context item is not a node, a dynamic error is raised.
  Michel Crampes           Cours XSLT et Xpath                       Septembre 2002




              Xpath ‘abrégé’ par l’exemple
Here are some examples of path expressions that use the abbreviated syntax:
   para selects the para element children of the context node
   * selects all element children of the context node
   text() selects all text node children of the context node
   @name selects the name attribute of the context node
   @* selects all the attributes of the context node
   para[1] selects the first para child of the context node
   para[xf:last()] selects the last para child of the context node
   */para selects all para grandchildren of the context node
   /doc/chapter[5]/section[2] selects the second section of the fifth chapter of the
       doc
      chapter//para    selects the para element descendants of the chapter element
       children of the context node
      //para selects all the para descendants of the document root and thus selects all
       para elements in the same document as the context node
      //list/member selects all the member elements in the same document as the context
       node that have an list parent
      . selects the context node
      .//para selects the para element descendants of the context node
      .. selects the parent of the context node
      ../@lang selects the lang attribute of the parent of the context node
      para[@type="warning"] selects all para children of the context node that have a
       type attribute with value warning
      para[@type="warning"][5] selects the fifth para child of the context node that has a
       typeattribute with value warning
      para[5][@type="warning"] selects the fifth para child of the context node if that
       child has a type attribute with value warning
      chapter[title="Introduction"] selects the chapter children of the context node
       that have one or more title children with string-value equal to Introduction
      chapter[title] selects the chapter children of the context node that have one or
       more title children
      employee[@secretary and @assistant] selects all the employee children of the
       context node that have both a secretary attribute and an assistant attribute
      book/(chapter|appendix)/section selects every section element that has a parent
       that is either a chapter or an appendix element, that in turn is a child of a book
       element that is a child of the context node.
       book/xf:id(publisher)/name returns the same result as
        xf:id(book/publisher)/name.
  Michel Crampes           Cours XSLT et Xpath                      Septembre 2002




  Autres extraits du documents Xpath 2.0
3.2.1 Steps
[20] StepExpr       ::= (ForwardStep | ReverseStep | PrimaryExpr) Predicates
[39] ForwardStep ::= (ForwardAxis NodeTest) | AbbreviatedForwardStep
[40] ReverseStep ::= (ReverseAxis NodeTest) | AbbreviatedReverseStep
A step generates a sequence of items and then filters the sequence by zero or more
predicates. The value of the step consists of those items that satisfy the predicates.
Predicates are described in 3.2.2 Predicates.
A step may consist of a primary expression (described in 3.1 Primary Expressions), a
forward step, or a reverse step. A forward or reverse step always returns a sequence of
nodes. A forward or reverse step might be thought of as beginning at the context node
and navigating to those nodes that are reachable from the context node via a specified
axis. Such a step has two parts: an axis, which defines the "direction of movement" for
the step, and a node test, which specifies the node kind and/or name of the nodes to be
selected by the step.
In the abbreviated syntax for a step, the axis can be omitted and other shorthand
notations can be used as described in 3.2.4 Abbreviated Syntax.
The unabbreviated syntax for a forward or reverse step consists of the axis name and
node test separated by a double colon. The result of the step consists of the nodes
reachable from the context node via the specified axis that have the node kind and/or
name specified by the node test. For example, the step child::para selects the para
element children of the context node: child is the name of the axis, and para is the name
of the element nodes to be selected on this axis. The available axes are described in
3.2.1.1 Axes. The available node tests are described in 3.2.1.2 Node Tests. Examples of
steps are provided in 3.2.3 Unabbreviated Syntax and 3.2.4 Abbreviated Syntax.
3.2.1.1 Axes
                                <"child" "::">
                                | <"descendant" "::">
                                | <"attribute" "::">
                                | <"self" "::">
[29]     ForwardAxis    ::=     | <"descendant-or-self" "::">
                                | <"following-sibling" "::">
                                | <"following" "::">
                                | <"namespace" "::">
                                <"parent" "::">
                                | <"ancestor" "::">
[30]     ReverseAxis    ::=     | <"preceding-sibling" "::">
                                | <"preceding" "::">
                                | <"ancestor-or-self" "::">
XPath defines a set of full set of axes for traversing documents, but a host language
may define a subset of these axes. The following axes are defined:
   the child axis contains the children of the context node
  Michel Crampes           Cours XSLT et Xpath                      Septembre 2002


     the descendant axis contains the descendants of the context node; a descendant is a
        child or a child of a child and so on; thus the descendant axis never contains
        attribute or namespace nodes
     the parent axis contains the parent of the context node, if there is one
     the ancestor axis contains the ancestors of the context node; the ancestors of the
        context node consist of the parent of context node and the parent's parent and so
        on; thus, the ancestor axis will always include the root node, unless the context
        node is the root node
     the following-sibling axis contains all the following siblings of the context node;
        if the context node is an attribute node or namespace node, the following-sibling
        axis is empty
     the preceding-sibling axis contains all the preceding siblings of the context node;
        if the context node is an attribute node or namespace node, the preceding-sibling
        axis is empty
     the following axis contains all nodes, in the same document or document fragment
        as the context node, that are after the context node in document order, excluding
        any descendants and excluding attribute nodes and namespace nodes
     the preceding axis contains all nodes, in the same document or document fragment
        as the context node, that are before the context node in document order, excluding
        any ancestors and excluding attribute nodes and namespace nodes
     the attribute axis contains the attributes of the context node; the axis will be
        empty unless the context node is an element
     the namespace axis contains the namespace nodes of the context node; the axis will
        be empty unless the context node is an element
     the self axis contains just the context node itself
     the descendant-or-self axis contains the context node and the descendants of the
        context node
     the ancestor-or-self axis contains the context node and the ancestors of the
        context node; thus, the ancestor-or-self axis will always include the root node
Axes can be categorized as forward axes and reverse axes. An axis that only ever
contains the context node or nodes that are after the context node in document order is a
forward axis. An axis that only ever contains the context node or nodes that are before
the context node in document order is a reverse axis.
In XPath, the parent, ancestor, ancestor-or-self, preceding, and preceding-sibling axes
are reverse axes; all other axes are forward axes. The ancestor, descendant, following,
preceding and self axes partition a document (ignoring attribute and namespace nodes):
they do not overlap and together they contain all the nodes in the document.
In a sequence of nodes selected by a step, the context positions of the nodes are
determined in a way that depends on the axis. If the axis is a forward axis, context
positions are assigned to the nodes in document order. If the axis is a reverse axis,
context positions are assigned to the nodes in reverse document order. In either case, the
first context position is 1.
  Michel Crampes           Cours XSLT et Xpath                       Septembre 2002


3.2.1.2 Node Tests
A node test is a condition that must be true for each node selected by a step. The
condition may be based on the kind of the node (element, attribute, text, document,
comment, processing instruction, or namespace) or on the name of the node.
[31] NodeTest                   ::= KindTest | NameTest
[32] NameTest                   ::= QName | Wildcard
[33] Wildcard                   ::= "*" | <NCName ":" "*"> | <"*" ":" NCName>
                                      ProcessingInstructionTest
                                      | CommentTest
[34]   KindTest                 ::=   | TextTest
                                      | AnyKindTest
       ProcessingInstructionT         <"processing-instruction" "(">
[35] est                           ::=StringLiteral? ")"
[36] CommentTest                   ::=<"comment" "("> ")"
[37]   TextTest                    ::= <"text" "("> ")"
[38] AnyKindTest                   ::= <"node" "("> ")"
Every axis has a principal node kind. If an axis can contain elements, then the principal
node kind is element; otherwise, it is the kind of nodes that the axis can contain. Thus:
     For the attribute axis, the principal node kind is attribute.
     For the namespace axis, the principal node kind is namespace.
     For all other axes, the principal node kind is element.
A node test that is a QName is true if and only if the kind of the node is the principal
node kind and the expanded-name of the node is equal to the expanded-name specified
by the QName. For example, child::para selects the para element children of the context
node; if the context node has no para children, it selects an empty set of nodes.
attribute::abc:href selects the attribute of the context node with the QName abc:href;
if the context node has no such attribute, it selects an empty set of nodes.
A QName in a node test is expanded into an expanded-name using the in-scope
namespaces in the expression context. An unprefixed QName used as a nametest has
the namespaceURI associated with the default element namespace in the expression
context. It is a static error if the QName has a prefix that does not correspond to any in-
scope namespace.
A node test * is true for any node of the principal node kind. For example, child::* will
select all element children of the context node, and attribute::* will select all attributes
of the context node.
A node test can have the form NCName:*. In this case, the prefix is expanded in the same
way as with a QName, using the context namespace declarations. It is a static error if
there is no namespace declaration for the prefix in the expression context. The node test
will be true for any node of the principal node kind whose expanded-name has the
namespace URI to which the prefix expands, regardless of the local part of the name.
A node test can also have the form *:NCName. In this case, the node test is true for any
node of the principal node kind whose local name matches the given NCName,
regardless of its namespace.
  Michel Crampes           Cours XSLT et Xpath                       Septembre 2002


The node test text() is true for any text node. For example, child::text() will select the
text node children of the context node. Similarly, the node test comment() is true for any
comment node, and the node test processing-instruction() is true for any processing
instruction. The processing-instruction() test may have an argument that is a
StringLiteral; in this case, it is true for any processing instruction whose target
application is equal to the value of the StringLiteral.
A node test node() is true for any node whatsoever.
Note:
In order to be consistent with QName in XML, whitespace is not allowed in the
Wildcard production. For instance "prefix:*" is allowed, but "prefix : *" is not allowed.
3.2.2 Predicates
[43]     Predicates     ::=     ("[" Expr "]")*
A predicate consists of an expression, called a predicate expression, enclosed in square
brackets. A predicate serves to filter a sequence, retaining some items and discarding
others. For each item in the sequence to be filtered, the predicate expression is evaluated
using an inner focus derived from that item, as described in 2.1.2 Evaluation Context.
The result of the predicate expression is coerced to a Boolean value, called the predicate
truth value, as described below. Those items for which the predicate truth value is true
are retained, and those for which the predicate truth value is false are discarded.
The predicate truth value is derived by applying the following rules, in order:
   1. If the value of the predicate expression is an empty sequence, the predicate truth
       value is false.
   2. If the value of the predicate expression is an atomic value of a numeric type, the
       predicate truth value is true if and only if the value of the predicate expression is
       equal to the context position.
   3. If the value of the predicate expression is an atomic value of type Boolean, the
       predicate truth value is equal to the value of the predicate expression.
   4. If the value of the predicate expression is a sequence that contains at least one
       node, the predicate truth value is true. The predicate truth value in this case does
       not depend on the content of the node(s).
   5. In any other case, a type exception is raised.
Here are some examples of steps that contain predicates:
    This example selects the second "chapter" element that is a child of the context
       node:
      child::chapter[2]
    This example selects all the descendants of the context node whose name is "toy"
     and whose "color" attribute has the value "red":
      descendant::toy[attribute::color = "red"]
    This example selects all the "employee" children of the context node that have a
     "secretary" subelement:
      child::employee[secretary]
A predicate can also be used with a primary expression that is not a forward or reverse
step, as illustrated in the following example:
  Michel Crampes          Cours XSLT et Xpath                       Septembre 2002


    List all the integers from 1 to 100 that are divisible by 5. (See 3.3.1 Constructing
     Sequences for an explanation of the to operator.)
      (1 to 100)[. mod 5 eq 0]

3.2.3 Unabbreviated Syntax
This section provides a number of examples of path expressions in which the axis is
explicitly specified in each step. The syntax used in these examples is called the
unabbreviated syntax. In many common cases, it is possible to write path expressions
more concisely using an abbreviated syntax, as explained in 3.2.4 Abbreviated
Syntax.
    child::para selects the para element children of the context node
    child::* selects all element children of the context node
    child::text() selects all text node children of the context node
    child::node() selects all the children of the context node, whatever their node
      type
    attribute::name selects the name attribute of the context node
    attribute::* selects all the attributes of the context node
    descendant::para selects the para element descendants of the context node
    ancestor::div selects all div ancestors of the context node
    ancestor-or-self::div selects the div ancestors of the context node and, if the
      context node is a div element, the context node as well
    descendant-or-self::para selects the para element descendants of the context node
      and, if the context node is a para element, the context node as well
    self::para selects the context node if it is a para element, and otherwise selects
      nothing
    child::chapter/descendant::para selects the para element descendants of the
      chapter element children of the context node
    child::*/child::para selects all para grandchildren of the context node
    / selects the root of the node hierarchy that contains the context node
    /descendant::para selects all the para elements in the same document as the
      context node
    /descendant::list/child::member selects all the member elements that have an list
      parent and that are in the same document as the context node
    child::para[xf:position() = 1] selects the first para child of the context node
    child::para[xf:position() = xf:last()] selects the last para child of the context
      node
    child::para[xf:position() = xf:last()-1] selects the last but one para child of
      the context node
    child::para[xf:position() > 1] selects all the para children of the context node
      other than the first para child of the context node
    following-sibling::chapter[xf:position() = 1]selects the next chapter sibling of
      the context node
  Michel Crampes           Cours XSLT et Xpath                      Septembre 2002


      preceding-sibling::chapter[xf:position() = 1]selects   the previous chapter
       sibling of the context node
      /descendant::figure[xf:position() = 42]   selects the forty-second figure element
       in the document
      /child::doc/child::chapter[xf:position() = 5]/child::section[xf:position() =
       2]selects the second section of the fifth chapter of the doc document element
      child::para[attribute::type="warning"]selects all para children of the context
       node that have a type attribute with value warning
      child::para[attribute::type='warning'][xf:position() = 5]selects the fifth para
       child of the context node that has a type attribute with value warning
      child::para[xf:position() = 5][attribute::type="warning"]selects the fifth para
       child of the context node if that child has a type attribute with value warning
      child::chapter[child::title='Introduction']selects the chapter children of the
       context node that have one or more title children with string-value equal to
       Introduction
      child::chapter[child::title]  selects the chapter children of the context node that
     have one or more title children
    child::*[self::chapter or self::appendix] selects the chapter and appendix
     children of the context node
    child::*[self::chapter or self::appendix][xf:position() = xf:last()] selects
     the last chapter or appendix child of the context node

3.2.4 Abbreviated Syntax
[41] AbbreviatedForwardStep            ::= "." | ("@" NameTest) | NodeTest
[42] AbbreviatedReverseStep            ::= ".."
The abbreviated syntax permits the following abbreviations:
   1. The most important abbreviation is that child:: can be omitted from a step. In
      effect, child is the default axis. For example, a path expression section/para is
      short for child::section/child::para.
   2. There is also an abbreviation for attributes: attribute:: can be abbreviated by @.
      For example, a path expression para[@type="warning"] is short for
      child::para[attribute::type="warning"] and so selects para children with a type
      attribute with value equal to warning.
   3. // is short for /descendant-or-self::node()/. For example, //para is short for
      /descendant-or-self::node()/child::para and so will select any para element in
      the document (even a para element that is a document element will be selected by
      //para since the document element node is a child of the root node); div1//para is
      short for div1/descendant-or-self::node()/child::para and so will select all para
      descendants of div1 children.
      Note that the path expression //para[1] does not mean the same as the path
      expression /descendant::para[1]. The latter selects the first descendant para
  Michel Crampes           Cours XSLT et Xpath                       Septembre 2002


        element; the former selects all descendant para elements that are the first para
        children of their parents.
     4. A step consisting of . returns the context item. This is particularly useful in
        conjunction with //. For example, the path expression .//para returns all para
        descendant elements of the context node.
     5. A step consisting of .. is short for parent::node(). For example, ../title is short
        for parent::node()/child::title and so will select the title children of the parent
        of the context node.
Here are some examples of path expressions that use the abbreviated syntax (voir ci-
dessus) :
.../...
3.3 Sequence Expressions
XPath supports operators to construct and combine sequences. A sequence is an ordered
collection of zero or more items. An item may be an atomic value or a node. An item is
identical to a sequence of length one containing that item. Sequences are never nested--
for example, combining the values 1, (2, 3), and ( ) into a single sequence results in the
sequence (1, 2, 3).
  Michel Crampes                Cours XSLT et Xpath                    Septembre 2002




                        La Grammaire XPath
A.2 BNF
The following grammar uses the same Basic EBNF notation as [XML], except that
grammar symbols always have initial capital letters. The EBNF contains the lexemes
embedded in the productions.
Note:
Note that the Semicolon character is reserved for future use.
NON-TERMINALS
[1]   XPath          ::=     ExprSequence?
[2]   ExprSequence   ::=     Expr ("," Expr)*
[3]   Expr           ::=     OrExpr
[4]   OrExpr         ::=     AndExpr ( "or" AndExpr )*
[5]   AndExpr        ::=     ForExpr ( "and" ForExpr )*
[6]   ForExpr        ::=     (ForClause "return")* QuantifiedExpr
                             ((<"some" "$"> | <"every" "$">) VarName "in" Expr (","
[7]   QuantifiedExpr ::=
                             "$" VarName "in" Expr)* "satisfies")* IfExpr
                             (<"if" "("> Expr ")" "then" Expr "else")*
[8]   IfExpr         ::=     InstanceofExpr
[9]   InstanceofExpr ::=     ComparisonExpr ( <"instance" "of"> SequenceType )?
                             RangeExpr ( (ValueComp
                             | GeneralComp
[10] ComparisonExpr ::=      | NodeComp
                             | OrderComp) RangeExpr )?
[11] RangeExpr      ::=      AdditiveExpr ( "to" AdditiveExpr )*
[12] AdditiveExpr ::=        MultiplicativeExpr ( ("+" | "-") MultiplicativeExpr )*
     Multiplicative
[13] Expr           ::=      UnionExpr ( ("*" | "div" | "idiv" | "mod") UnionExpr )*
                             IntersectExceptExpr ( ("union" | "|")
[14] UnionExpr         ::=   IntersectExceptExpr )*
      IntersectExcep
[15] tExpr             ::=   UnaryExpr ( ("intersect" | "except") UnaryExpr )*

[16] UnaryExpr         ::=   ("-" | "+")* ValueExpr
[17] ValueExpr         ::=   ValidateExpr | CastExpr | PathExpr
                             ("/" RelativePathExpr?) | ("//" RelativePathExpr) |
[18] PathExpr          ::=   RelativePathExpr
      RelativePathEx
[19] pr                ::=   StepExpr (("/" | "//") StepExpr)*

[20] StepExpr          ::=   (ForwardStep | ReverseStep | PrimaryExpr) Predicates
                             <"for" "$"> VarName "in" Expr ("," "$" VarName "in"
[21] ForClause         ::=   Expr)*
[22] ValidateExpr      ::=   "validate" SchemaContext? "{" Expr "}"
                             (<"cast" "as"> | <"treat" "as">) SequenceType
[23] CastExpr          ::=   ParenthesizedExpr
[24] GeneralComp       ::=   "=" | "!=" | "<" | "<=" | ">" | ">="
[25] ValueComp         ::=   "eq" | "ne" | "lt" | "le" | "gt" | "ge"
[26] NodeComp          ::=   "is" | "isnot"
[27] OrderComp         ::=   "<<" | ">>"
  Michel Crampes              Cours XSLT et Xpath                      Septembre 2002


                           Literal | FunctionCall | ("$" VarName) |
[28] PrimaryExpr     ::=   ParenthesizedExpr
                           <"child" "::">
                           | <"descendant" "::">
                           | <"attribute" "::">
                           | <"self" "::">
[29] ForwardAxis     ::=   | <"descendant-or-self" "::">
                           | <"following-sibling" "::">
                           | <"following" "::">
                           | <"namespace" "::">
                           <"parent" "::">
                           | <"ancestor" "::">
[30] ReverseAxis     ::=   | <"preceding-sibling" "::">
                           | <"preceding" "::">
                           | <"ancestor-or-self" "::">
[31] NodeTest        ::=   KindTest | NameTest
[32] NameTest        ::=   QName | Wildcard
[33] Wildcard        ::=   "*" | <NCName ":" "*"> | <"*" ":" NCName>
                           ProcessingInstructionTest
                           | CommentTest
[34] KindTest        ::=   | TextTest
                           | AnyKindTest
    ProcessingInst
[35] ructionTest    ::=    <"processing-instruction" "("> StringLiteral? ")"

[36] CommentTest    ::=    <"comment" "("> ")"
[37] TextTest       ::=    <"text" "("> ")"
[38] AnyKindTest    ::=    <"node" "("> ")"
[39] ForwardStep    ::=    (ForwardAxis NodeTest) | AbbreviatedForwardStep
[40] ReverseStep    ::=    (ReverseAxis NodeTest) | AbbreviatedReverseStep
     AbbreviatedFor
[41] wardStep       ::=    "." | ("@" NameTest) | NodeTest
    AbbreviatedRev
[42] erseStep       ::=    ".."

[43] Predicates     ::=    ("[" Expr "]")*
[44] NumericLiteral ::=    IntegerLiteral | DecimalLiteral | DoubleLiteral
[45] Literal        ::=    NumericLiteral | StringLiteral
     ParenthesizedE
[46] xpr            ::=    "(" ExprSequence? ")"

[47] FunctionCall ::=      <QName "("> (Expr ("," Expr)*)? ")"
[48] SchemaContext ::=     "in" SchemaGlobalContext ("/" SchemaContextStep)*
     SchemaGlobalCo
[49] ntext          ::=    QName | <"type" QName>
    SchemaContextS
[50] tep             ::=   QName

[51] SequenceType    ::=   (ItemType OccurrenceIndicator) | "empty"
                           (("element" | "attribute") ElemOrAttrType?)
                           | "node"
                           | "processing-instruction"
                           | "comment"
                           | "text"
[52] ItemType        ::=   | "document"
                           | "item"
                           | AtomicType
                           | "untyped"
                           | <"atomic" "value">
  Michel Crampes             Cours XSLT et Xpath                   Septembre 2002


[53] ElemOrAttrType ::=   (QName (SchemaType | SchemaContext?)) | SchemaType
[54] SchemaType     ::=   <"of" "type"> QName
[55] AtomicType     ::=   QName
     OccurrenceIndi
[56] cator          ::=   ("*" | "*" | "+" | "?")?
Michel Crampes    Cours XSLT et Xpath   Septembre 2002




                 Annexe Cours XSLT
  Michel Crampes             Cours XSLT et Xpath   Septembre 2002




                   Liste des éléments XSL 1.0
(Extrait de Saxon : )
xsl:apply-imports
xsl:apply-templates
xsl:attribute
xsl:attribute-set
xsl:call-template
xsl:choose
xsl:comment
xsl:copy
xsl:copy-of
xsl:decimal-format
xsl:document
xsl:element
xsl:fallback
xsl:for-each
xsl:if
xsl:include
xsl:import
xsl:key
xsl:message
xsl:namespace-alias
xsl:number
xsl:otherwise
xsl:output
xsl:param
xsl:processing-instruction
xsl:preserve-space
xsl:script
xsl:sort
xsl:strip-space
xsl:stylesheet
xsl:template
xsl:text
xsl:value-of
xsl:variable
xsl:when
xsl:with-param
  Michel Crampes             Cours XSLT et Xpath                   Septembre 2002




XSLT Patterns
Contents
Introduction
Pattern syntax

Introduction
This document gives an informal description of the syntax of XSLT patterns. For
a formal specification, see the XSLT recommendation.
Patterns define a condition that a node may or may not satisfy: a node either
matches the pattern, or it does not. The syntax of patterns is a subset of that for
Nodeset Expressions (defined in expressions.html), and formally, a node
matches a pattern if it is a member of the node set selected by the
corresponding expression, with some ancestor of the node acting as the current
node for evaluating the expression. For example a TITLE node matches the
pattern "TITLE" because it is a member of the node set selected by the
expression "TITLE" when evaluated at the immediate parent node.
XSLT patterns may be used either in an XSLT stylesheet, or as a parameter to
various Java interfaces in the Saxon API. The syntax is the same in both cases.
In the Java interface, patterns are encapsulated by the com.icl.saxon.Pattern
class, and are created by calling the static method Pattern.make().
In style sheets, patterns are used primarily in the match attribute of the
xsl:template element. They are also used in the count and from attributes of
xsl:number, and the match attribute of xsl:key. In Java applications, patterns are
used when nominating a node handler using Controller.setHandler().

Pattern syntax

Saxon supports the full XSLT syntax for patterns. The rules below describe a
simplified form of this syntax (for example, it omits the legal but useless pattern
'@comment()'):
pattern            ::= path ( '|' path )*
path               ::= anchor? remainder? (Note 1)

anchor             ::= '/' | '//' | id | key
id                 ::= 'id' '(' literal ')'
key                ::= 'key' '(' literal ',' literal ')'

remainder          ::=   path-part ( sep path-part )*
sep                ::=   '/' | '//'
path-part          ::=   node-match predicate+
node-match         ::=   element-match | text-match | attribute-match | pi-match |
node-match
  Michel Crampes              Cours XSLT et Xpath                                Septembre 2002


element-match       ::=   'child::'? ( name | '*' )
text-match          ::=   'text' '(' ')'
attribute-match     ::=   ('attribute::' | '@') ( name | '*' )
pi-match            ::=   'processing-instruction' '(' literal? ')'
node-match          ::=   'node' '(' ')'

predicate           ::= '[' ( boolean-expression | numeric-expression ) ']'
Note 1: not all combinations are allowed. If the anchor is '//' then the remainder
is mandatory.
The form of a literal is as defined in expressions; and a predicate is itself a
boolean or numeric expression. As with predicates in expressions, a numeric
predicate [P] is shorthand for the boolean predicate [position()=P].
Informally, a pattern consists of either a single path or a sequence of paths
separated by vertical bars. An element matches the match-pattern if it matches
any one of the paths.
A path consists of a sequence of path-parts separated by either "/" or "//". There
is an optional separator ("/" or "//") at the start; a "//" has no effect and can be
ignored. The last path-part may be an element-match, a text-match, an attribute-
match, a pi-match, or a node-match; in practice, a path-part other than the last
should be an element-match.
The axis syntax child:: and attribute:: may also be used in patterns, as described
in the XSLT specification.
Examples of patterns:
Pattern                                       Meaning
XXX                                           Matches any element whose name (tag) is XXX
*                                             Matches any element
XXX/YYY                                       Matches any YYY element whose parent is an
                                              XXX
XXX//YYY                                      Matches any YYY element that has an
                                              ancestor named XXX
/*/XXX                                        Matches any XXX element that is immediately
                                              below the top-level element in the document
*[@NAME]                                      Matches any element with a NAME attribute
SECTION/PARA[1]                               Matches any PARA element that is the first
                                              PARA child of a SECTION element
SECTION[TITLE="Contents"]                     Matches any SECTION element whose first
                                              TITLE child element has the value "Contents"
A/TITLE | B/TITLE | C/TITLE                   Matches any TITLE element whose parent is of
                                              type A or B or C (Note that this cannot be
                                              written "(A|B|C)/TITLE", although that is a valid
                                              node-set expression.)
/BOOK//*                                      Matches any element in a document provided
                                              the top-level element in the document is named
                                              "BOOK"
A/text()                                      Matches the character content of an A element
A/@*                                          Matches any attribute of an A element
   Michel Crampes              Cours XSLT et Xpath                              Septembre 2002




                              Annexe Cours XSLT
Michel Crampes
Ecole des Mines d‟Ales
Aout 2002


Extrait de :
                           XSL Transformations (XSLT) Version 2.0
                             W3C Working Draft 16 August 2002
                               http://www.w3.org/TR/xslt20/
C Element Syntax Summary (Non-Normative)

The syntax of each XSLT element is summarized below, together with the context in the stylesheet
where the element may appear. Some elements (specifically,
instructions) are allowed as a child of any element that is allowed to contain a content constructor.
These elements are:

   xsl:attribute                   xsl:comment                      xsl:copy
   xsl:element                     xsl:fallback                     xsl:for-each
   xsl:for-each-group              xsl:if                           xsl:matching-substring
   xsl:message                     xsl:namespace                    xsl:non-matching-
                                                                 substring
   xsl:otherwise                   xsl:param                        xsl:processing-instruction
   xsl:result                      xsl:result-document              xsl:template
   xsl:text                        xsl:variable                     xsl:when
   xsl:with-param                  Literal result elements          Extension instructions, if
                                                                 so defined

1.1 xsl:analyze-string
Category: instruction
Model:
       <xsl:analyze-string
         select = expression
         regex = { string }
         flags = { string }>
         <!-- Content: (xsl:matching-substring?, xsl:non-matching-substring?) -->
        </xsl:analyze-string>
Permitted parent elements:
               any XSLT element whose content model is content constructor
               any literal result element
   Michel Crampes               Cours XSLT et Xpath                          Septembre 2002




1.2 xsl:apply-imports
Category: instruction
Model:
       <xsl:apply-imports>
         <!-- Content: xsl:with-param* -->
        </xsl:apply-imports>
Permitted parent elements:
               any XSLT element whose content model is content constructor
               any literal result element
1.3 xsl:apply-templates
Category: instruction
Model:
       <xsl:apply-templates
         select = node-sequence-expression
         mode = token>
         <!-- Content: (xsl:sort | xsl:with-param)* -->
        </xsl:apply-templates>
Permitted parent elements:
               any XSLT element whose content model is content constructor
               any literal result element
1.4 xsl:attribute
Category: instruction
Model:
       <xsl:attribute
         name = { qname }
         namespace = { uri-reference }
         type-annotation = qname
         disable-output-escaping = "yes" | "no">
         <!-- Content: content-constructor -->
        </xsl:attribute>
Permitted parent elements:
               xsl:attribute-set
               any XSLT element whose content model is content constructor
               any literal result element
1.5 xsl:attribute-set
Category: declaration
Model:
       <xsl:attribute-set
         name = qname
         use-attribute-sets = qnames>
         <!-- Content: xsl:attribute* -->
        </xsl:attribute-set>
Permitted parent elements:
               xsl:stylesheet
               xsl:transform
1.6 xsl:call-template
  Michel Crampes             Cours XSLT et Xpath                             Septembre 2002


Category: instruction
Model:
        <xsl:call-template
         name = qname>
         <!-- Content: xsl:with-param* -->
        </xsl:call-template>
Permitted parent elements:
               any XSLT element whose content model is content constructor
               any literal result element
1.7 xsl:choose
Category: instruction
Model:
       <xsl:choose>
         <!-- Content: (xsl:when+, xsl:otherwise?) -->
        </xsl:choose>
Permitted parent elements:
               any XSLT element whose content model is content constructor
               any literal result element
1.8 xsl:comment
Category: instruction
Model:
       <xsl:comment>
         <!-- Content: content-constructor -->
        </xsl:comment>
Permitted parent elements:
               any XSLT element whose content model is content constructor
               any literal result element
1.9 xsl:copy
Category: instruction
Model:
        <xsl:copy
         use-attribute-sets = qnames>
         <!-- Content: content-constructor -->
        </xsl:copy>
Permitted parent elements:
               any XSLT element whose content model is content constructor
               any literal result element
1.10 xsl:copy-of
Category: instruction
Model:
        <xsl:copy-of
         select = expression
         separator = { string }
         copy-type-annotations = "yes" | "no" />
Permitted parent elements:
               any XSLT element whose content model is content constructor
               any literal result element
   Michel Crampes              Cours XSLT et Xpath                            Septembre 2002


1.11 xsl:decimal-format
Category: declaration
Model:
        <xsl:decimal-format
         name = qname
         decimal-separator = char
         grouping-separator = char
         infinity = string
         minus-sign = char
         NaN = string
         percent = char
         per-mille = char
         zero-digit = char
         digit = char
         pattern-separator = char />
Permitted parent elements:
               xsl:stylesheet
               xsl:transform
1.12 xsl:element
Category: instruction
Model:
        <xsl:element
          name = { qname }
          namespace = { uri-reference }
          use-attribute-sets = qnames
          type-annotation = qname>
          <!-- Content: content-constructor -->
         </xsl:element>
Permitted parent elements:
                any XSLT element whose content model is content constructor
                any literal result element
xsl:fallback
Category: instruction
Model:
        <xsl:fallback>
          <!-- Content: content-constructor -->
         </xsl:fallback>
Permitted parent elements:
                any XSLT element whose content model is content constructor
                any literal result element
1.13 xsl:for-each
Category: instruction
Model:
       <xsl:for-each
         select = sequence-expression>
         <!-- Content: (xsl:sort*, content-constructor) -->
        </xsl:for-each>
Permitted parent elements:
   Michel Crampes               Cours XSLT et Xpath                              Septembre 2002


               any XSLT element whose content model is content constructor
               any literal result element
1.14 xsl:for-each-group
Category: instruction
Model:
       <xsl:for-each-group
         select = expression
         group-by = expression
         group-adjacent = expression
         group-starting-with = pattern
         group-ending-with = pattern
         collation = { uri }
         type = qname>
         <!-- Content: (xsl:sort*, content-constructor) -->
        </xsl:for-each-group>
Permitted parent elements:
               any XSLT element whose content model is content constructor
               any literal result element
1.15 xsl:function
Category: declaration
Model:
       <xsl:function
         name = qname
         override = "yes" | "no">
         <!-- Content: (xsl:param*, (xsl:variable | xsl:message)*, xsl:result) -->
        </xsl:function>
Permitted parent elements:
               xsl:stylesheet
               xsl:transform
1.16 xsl:if
Category: instruction
Model:
       <xsl:if
         test = expression>
         <!-- Content: content-constructor -->
        </xsl:if>
Permitted parent elements:
               any XSLT element whose content model is content constructor
               any literal result element
1.17 xsl:import
Category: declaration
Model:
       <xsl:import
         href = uri-reference />
Permitted parent elements:
               xsl:stylesheet
               xsl:transform
   Michel Crampes               Cours XSLT et Xpath                          Septembre 2002


1.18 xsl:import-schema
Category: declaration
Model:
       <xsl:import-schema
         namespace = uri-reference
         schema-location = uri-reference />
Permitted parent elements:
              xsl:stylesheet
              xsl:transform
1.19 xsl:include
Category: declaration
Model:
       <xsl:include
         href = uri-reference />
Permitted parent elements:
               xsl:stylesheet
               xsl:transform
1.20 xsl:key
Category: declaration
Model:
        <xsl:key
         name = qname
         match = pattern
         use = expression
         type = qname
         collation = uri />
Permitted parent elements:
               xsl:stylesheet
               xsl:transform
1.21 xsl:matching-substring
Model:
        <xsl:matching-substring>
         <!-- Content: content-constructor -->
        </xsl:matching-substring>
Permitted parent elements:
               xsl:analyze-string
1.22 xsl:message
Category: instruction
Model:
        <xsl:message
         terminate = { "yes" | "no" }>
         <!-- Content: content-constructor -->
        </xsl:message>
Permitted parent elements:
               any XSLT element whose content model is content constructor
               any literal result element
               xsl:function
   Michel Crampes               Cours XSLT et Xpath                       Septembre 2002


1.23 xsl:namespace
Category: instruction
Model:
        <xsl:namespace
         name = { ncname }>
         <!-- Content: content-constructor -->
        </xsl:namespace>
Permitted parent elements:
           any XSLT element whose content model is content constructor
           any literal result element
1.24 xsl:namespace-alias
Category: declaration
Model:
        <xsl:namespace-alias
         stylesheet-prefix = prefix | "#default"
         result-prefix = prefix | "#default" />
Permitted parent elements:
           xsl:stylesheet
           xsl:transform
1.25 xsl:non-matching-substring
Model:
        <xsl:non-matching-substring>
         <!-- Content: content-constructor -->
        </xsl:non-matching-substring>
Permitted parent elements:
           xsl:analyze-string
1.26 xsl:number
Category: instruction
Model:
       <xsl:number
        level = "single" | "multiple" | "any"
        count = pattern
        from = pattern
        value = number-expression
        format = { string }
        lang = { nmtoken }
        letter-value = { "alphabetic" | "traditional" }
        grouping-separator = { char }
        grouping-size = { number } />

         Permitted parent elements:
            any XSLT element whose content model is content constructor
            any literal result element
1.27 xsl:otherwise
Model:
         <xsl:otherwise>
          <!-- Content: content-constructor -->
   Michel Crampes               Cours XSLT et Xpath                          Septembre 2002


        </xsl:otherwise>
Permitted parent elements:
           xsl:choose
1.28 xsl:output
Category: declaration
Model:
        <xsl:output
         name = qname
         method = "xml" | "html" | "xhtml" | "text" | qname-but-not-ncname
         version = nmtoken
         encoding = string
         omit-xml-declaration = "yes" | "no"
         standalone = "yes" | "no"
         doctype-public = string
         doctype-system = string
         cdata-section-elements = qnames
         escape-uri-attributes = "yes" | "no"
         include-content-type = "yes" | "no"
         indent = "yes" | "no"
         media-type = string />
Permitted parent elements:
           xsl:stylesheet
           xsl:transform
1.29 xsl:param
Category: declaration
Model:
        <xsl:param
         name = qname
         select = expression
         type = sequence-type
         type-information = "strict" | "lax" | "preserve" | "none">
         <!-- Content: content-constructor -->
        </xsl:param>
Permitted parent elements:
           xsl:stylesheet
           xsl:transform
           xsl:function
           xsl:template
1.30 xsl:preserve-space
Category: declaration
Model:
        <xsl:preserve-space
         elements = tokens />
Permitted parent elements:
           xsl:stylesheet
           xsl:transform
1.31 xsl:principal-result-document
   Michel Crampes               Cours XSLT et Xpath                      Septembre 2002


Category: declaration
Model:
        <xsl:principal-result-document
         format = qname
         href = { uri-reference }
         type-information = "strict" | "lax" | "preserve" | "none" />
Permitted parent elements:
           xsl:stylesheet
           xsl:transform
1.32 xsl:processing-instruction
Category: instruction
Model:
        <xsl:processing-instruction
         name = { ncname }>
         <!-- Content: content-constructor -->
        </xsl:processing-instruction>
Permitted parent elements:
           any XSLT element whose content model is content constructor
           any literal result element
1.33 xsl:result
Model:
        <xsl:result
         select = expression
         type = sequence-type
         type-information = "strict" | "lax" | "preserve" | "none">
         <!-- Content: content-constructor -->
        </xsl:result>
Permitted parent elements:
           xsl:function
1.34 xsl:result-document
Category: instruction
Model:
        <xsl:result-document
         format = qname
         href = { uri-reference }
         type-information = "strict" | "lax" | "preserve" | "none">
         <!-- Content: content-constructor -->
        </xsl:result-document>
Permitted parent elements:
           any XSLT element whose content model is content constructor
           any literal result element
1.35 xsl:sort
Model:
         <xsl:sort
          select = expression
          lang = { nmtoken }
          type = { qname }
   Michel Crampes               Cours XSLT et Xpath                    Septembre 2002


         order = { "ascending" | "descending" }
         collation = { uri }
         case-order = { "upper-first" | "lower-first" }
         data-type = { "text" | "number" | qname-but-not-ncname } />
Permitted parent elements:
           xsl:sort-key
           xsl:for-each
           xsl:apply-templates
           xsl:for-each-group
1.36 xsl:sort-key
Category: declaration
Model:
        <xsl:sort-key
         name = qname>
         <!-- Content: (xsl:sort+) -->
        </xsl:sort-key>
Permitted parent elements:
           xsl:stylesheet
           xsl:transform
1.37 xsl:strip-space
Category: declaration
Model:
        <xsl:strip-space
         elements = tokens />
Permitted parent elements:
           xsl:stylesheet
           xsl:transform
1.38 xsl:stylesheet
Model:
        <xsl:stylesheet
         id = id
         extension-element-prefixes = tokens
         exclude-result-prefixes = tokens
         exclude-prefixes = tokens
         version = number
         default-xpath-namespace = uri>
         <!-- Content: (xsl:import*, top-level-elements) -->
        </xsl:stylesheet>
Permitted parent elements:
           None
1.39 xsl:template
Category: declaration
Model:
       <xsl:template
        match = pattern
        name = qname
        priority = number
  Michel Crampes               Cours XSLT et Xpath                       Septembre 2002


         mode = tokens>
         <!-- Content: (xsl:param*, content-constructor) -->
        </xsl:template>
Permitted parent elements:
           xsl:stylesheet
           xsl:transform
1.40 xsl:text
Category: instruction
Model:
        <xsl:text
         disable-output-escaping = "yes" | "no">
         <!-- Content: content-constructor -->
        </xsl:text>
Permitted parent elements:
           any XSLT element whose content model is content constructor
           any literal result element
1.41 xsl:transform
Model:
        <xsl:transform
         id = id
         extension-element-prefixes = tokens
         exclude-result-prefixes = tokens
         exclude-prefixes = tokens
         version = number
         default-xpath-namespace = uri>
         <!-- Content: (xsl:import*, top-level-elements) -->
        </xsl:transform>
Permitted parent elements:
           None
1.42 xsl:value-of
Category: instruction
Model:
        <xsl:value-of
         select = expression
         separator = { string }
         disable-output-escaping = "yes" | "no" />
Permitted parent elements:
           any XSLT element whose content model is content constructor
           any literal result element
1.43 xsl:variable
Category: declaration
Model:
       <xsl:variable
        name = qname
        select = expression
        type = sequence-type
        type-information = "strict" | "lax" | "preserve" | "none">
   Michel Crampes               Cours XSLT et Xpath                      Septembre 2002


         <!-- Content: content-constructor -->
        </xsl:variable>
Permitted parent elements:
           xsl:stylesheet
           xsl:transform
           xsl:function
           any XSLT element whose content model is content constructor
           any literal result element
1.44 xsl:when
Model:
        <xsl:when
         test = expression>
         <!-- Content: content-constructor -->
        </xsl:when>
Permitted parent elements:
           xsl:choose
1.45 xsl:with-param
Model:
        <xsl:with-param
         name = qname
         select = expression
         type-information = "strict" | "lax" | "preserve" | "none">
         <!-- Content: content-constructor -->
        </xsl:with-param>
Permitted parent elements:
           xsl:apply-templates
           xsl:apply-imports
           xsl:call-template

				
DOCUMENT INFO
Shared By:
Stats:
views:7
posted:8/10/2010
language:French
pages:70