English
|
>> Français <<
|
Deutsch
|
Magyar
|
中文
thebigdir
>
Tutorials
>
XSLT Tutorial
Intro
/
Chercher
/
home loan mortgage equity refinancing calculator lender rates
>> Page 1 <<
|
Précédent
|
Suivant
|
Contenu
|
Index des éléments
Le langage XSL vous permet de modifier librement n'importe quel texte source.
Feuille de style XSLT 1
et
Feuille de style XSLT 2
génèrent deux sorties différentes à partir du même fichier source.
Feuille de style XSLT 1
Source XML
<source>
<title>XSL</title>
<author>John Smith</author>
</source>
Sortie
<h1>XSL</h1>
<h2>John Smith</h2>
Vue HTML
XSL
John Smith
Feuille de style XSLT
<
xsl:stylesheet
version
= '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<
xsl:template
match
="/">
<
h1
>
<
xsl:value-of
select
="//title"/>
</
h1
>
<
h2
>
<
xsl:value-of
select
="//author"/>
</
h2
>
</
xsl:template
>
</
xsl:stylesheet
>
Feuille de style XSLT 2
Source XML
<source>
<title>XSL</title>
<author>John Smith</author>
</source>
Sortie
<h2>John Smith</h2>
<h1>XSL</h1>
Vue HTML
John Smith
XSL
Feuille de style XSLT
<
xsl:stylesheet
version
= '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<
xsl:template
match
="/">
<
h2
>
<
xsl:value-of
select
="//author"/>
</
h2
>
<
h1
>
<
xsl:value-of
select
="//title"/>
</
h1
>
</
xsl:template
>
</
xsl:stylesheet
>