English
|
Français
|
Deutsch
|
>> Magyar <<
|
中文
thebigdir
>
Tutorials
>
XSLT Tutorial
Bevezetés
/
Keresés
/
home loan mortgage equity refinancing calculator lender rates
>> Oldal 4 <<
|
Előző
|
Következő
|
Tartalom
|
Elem index
Az eredeti elemek tartalmai két alapvet? módon nyerhet?ek ki. Az
XSLT stíluslap 1
az xsl:value-of módszert használja. Ebben az esetben az elemek konkrét értékei vannak használva, bármilyen további feldolgozás nélkül. Az xsl:apply-templates instrukció az
XSLT stíluslap 2
példában kül?nb?z?. A feldolgozó további feldolgozást végez a megadott elemeken, melyekhez sablon van megadva.
XSLT stíluslap 1
home loan forrás
<source>
<employee>
<firstName>Joe</firstName>
<surname>Smith</surname>
</employee>
</source>
Kimenet
<b>
Joe
Smith
</b>
HTML nézet
Joe Smith
XSLT stíluslap
<
xsl:stylesheet
version
= '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<
xsl:template
match
="employee">
<
b
>
<
xsl:value-of
select
="."/>
</
b
>
</
xsl:template
>
<
xsl:template
match
="surname">
<
i
>
<
xsl:value-of
select
="."/>
</
i
>
</
xsl:template
>
</
xsl:stylesheet
>
XSLT stíluslap 2
home loan forrás
<source>
<employee>
<firstName>Joe</firstName>
<surname>Smith</surname>
</employee>
</source>
Kimenet
<b>Joe</b>
<b>
<i>Smith</i>
</b>
HTML nézet
Joe
Smith
XSLT stíluslap
<
xsl:stylesheet
version
= '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<
xsl:template
match
="employee">
<
b
>
<
xsl:apply-templates
select
="firstName"/>
</
b
>
<
b
>
<
xsl:apply-templates
select
="surname"/>
</
b
>
</
xsl:template
>
<
xsl:template
match
="surname">
<
i
>
<
xsl:value-of
select
="."/>
</
i
>
</
xsl:template
>
</
xsl:stylesheet
>