XML:
<? XML version = "1.0" encoding = "gb2312"?>
-<Rows>
-<Game id ="
12">
<Shortname>
Yi Jia</Shortname>
<Name>
Serie A League</Name>
<Hostname>
Azio</Hostname>
<Guestname>
Atlan grand</Guestname>
<Color>
# 0066ff</Color>
</Game>
-<Game id ="
13">
<Shortname>
Premier League</Shortname>
<Name>
Premier League</Name>
<Hostname>
Ashenu</Hostname>
<Guestname>
Chelushi</Guestname>
<Color>
# Bb1111</Color>
</Game>
-<Game id ="
14">
<Shortname>
Yi Jia</Shortname>
<Name>
Serie A League</Name>
<Hostname>
Atlan grand</Hostname>
<Guestname>
Freentianna</Guestname>
<Color>
# 0066ff</Color>
</Game>
</Rows>
XSLT:
<? XML version = "1.0" encoding = "gb2312"?>
-<XSL: stylesheet version ="
1.0"Xmlns: XSL ="
Http://www.w3.org/1999/XSL/Transform">
<XSL: variable name ="
Mache_name">
League name</XSL: Variable>
<XSL: variable name ="
Host_team">
Main Team</XSL: Variable>
<XSL: variable name ="
Guest_team">
Team</XSL: Variable>
-<XSL: template match ="
/">
-<HTML>
-<Head>
<Title>
Test XSLT</Title>
</Head>
-<Body>
The total number of records is:
<XSL: value-of select ="
Count (rows/game)"/>
-<Table border ="
1">
-<Tr>
-<TH>
<XSL: value-of select ="
$ Mache_name"/>
</Th>
-<TH>
<XSL: value-of select ="
$ Host_team"/>
</Th>
-<TH>
<XSL: value-of select ="
$ Guest_team"/>
</Th>
</Tr>
-<XSL: Apply-templates select ="
Rows/Game">
<XSL: Sort select ="
@ ID"Order ="
Descending"/>
</XSL: Apply-templates>
</Table>
<Br/>
</Body>
</Html>
</XSL: Template>
-<XSL: template match ="
Game">
-<Tr>
-<TD>
<XSL: value-of select ="
Name"/>
[
<XSL: value-of select ="
Shortname"/>
]
</TD>
-<TD>
<XSL: value-of select ="
Hostname"/>
</TD>
-<TD>
-<XSL: Choose>
-<XSL: When test ="
@ ID = 14">
-<Font color ="
Red">
<XSL: value-of select ="
Guestname"/>
</Font>
</XSL: When>
-<XSL: otherwise>
<XSL: value-of select ="
Guestname"/>
</XSL: otherwise>
</XSL: Choose>
</TD>
</Tr>
</XSL: Template>
</XSL: stylesheet>