Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
xslt2

xslt2

Ratings: (0)|Views: 26|Likes:
Published by Anovar_ebooks

More info:

Published by: Anovar_ebooks on Sep 14, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/31/2011

pdf

text

original

 
2/10/20091
XSLT 2Créationdynamique
d’éléments
&attributsxsl:copy
<xsl:copyuse-attribute-
sets=”
qnames
”>
<!--Content: template --></xsl:copy>Copie peu profonde
Exemple
<xsl:templatematch="p"><xsl:copyuse-attribute-sets="P "><xsl:value-of select="."/></xsl:copy></xsl:template><xsl:attribute-set name="P"><xsl:attributename="align">left</xsl:attribute><xsl:attributename="style">color:blue</xsl:attribute></xsl:attribute-set><p align="left" style="color:blue">Hello, world!</p><p>Hello, world!</p>
 
2/10/20092
Exemple
<xsl:stylesheet>
<xsl:template
match=“@*|node()”>
<xsl:copy><xsl:apply-templatesselect=
=“@*|node()”/>
</xsl:copy></xsl:template></stylesheet>Transformation identitéAttention aux axes implicites:child::node() ne selectionnepas les attributs
Exemple
<xsl:templatematch
=“node()”>
</stylesheet>Cette pattern ne
matche 
pas les nœuds
attributs
et les nœuds
namespace
xsl:copy-of
<xsl:copy-
of select=“expression”>
<!--Content: template --></xsl:copy>
Copie profonde: insertion d’un fragment dansl’arbre résultat. Copie les attributs, les
namespaceset les descendants
<xsl:elementname
=“
name” 
namespace= 
URI 
use-attribute-sets
=”
qnames
”>
<!-- Content: template--> 
</xsl:element>
CetélémentXSL estutilisépour créerun élémentavec un nom calculé
xsl:element
 
2/10/20093
xsl:attribute
CetélémentXSL estutilisépour créerun attributà un élément
<xsl:attributename
=“
name 
<!-- Attribute value: template --> 
</xsl:attribute>
Exemple
<picture><xsl:attributename="source"><xsl:value-of select="images/name" /></xsl:attribute></picture><xsl:elementname = "QQQ" ><xsl:attributename = "xxx" >111</xsl:attribute><xsl:attributename =
"{name(*[1])}"
><xsl:value-of select = "//BBB" /></xsl:attribute></xsl:element>
Nom calculéAttribut value template
Exemple
<xsl:stylesheetxmlns:xsl="http://www.w3.org/1999/XSL/Transform"version="1.0"><xsl:outputmethod="xml"/><xsl:templatematch="*"><xsl:elementname="{name(.)}"><xsl:for-each select="@*"><xsl:attributename="{name(.)}"><xsl:value-of select="."/></xsl:attribute></xsl:for-each><xsl:apply-templates/></xsl:element></xsl:template></xsl:stylesheet>
Elimination des namespacespi et comments
Eléments acceptablesau niveau global

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->