|
|
|
|
|
|
| |
XSLT Tutorial
Worksheet 6: xsl:choose, xsl:when
Following on from our Workshop 5 example, let's rather implement this
example with the xsl:choose and xsl:when
instructions:
Once again from the Worksheet_6 directory open the Headline XML:
<headlines>
<article>Rescued penguins swim home
<summary>Some 150
penguins unaffected ...</summary>
<category>Science
& Nature</category>
</article>
<article>Bug mops up sewage
<summary>A bug found in sewage water
has...</summary>
<category>Science &
Nature</category>
</article>
<article>In the land of the colour-blind
<summary>A hunt to find the cause of widespread
...</summary>
<category>Health</category>
</article>
</headlines>
Here's what to do:
Open the todaysnews.xsl file, and change it so that every odd
article is in blue and every even article is in red.
The HTML result should be:
Today's Headlines
Rescued penguins swim home
Bug mops up sewage
In the land of the colour-blind
A: Solution
|
|
|
|
|
|
|
|
|