Datasheet
Williams c01.tex V3 - 07/31/2009 2:53pm Page 23
Chapter 1: First Steps with XSLT
<link>http://feeds.oreilly.com/oreilly/xml</link>
<items>
<rdf:Seq>
<rdf:li rdf:resource
=
"tag:broadcast.oreilly.com,2008://53.34667"/>
<rdf:li rdf:resource
=
"tag:broadcast.oreilly.com,2008://53.34679"/>
<rdf:li rdf:resource
=
"tag:broadcast.oreilly.com,2008://53.34620"/>
<rdf:li rdf:resource
=
"tag:broadcast.oreilly.com,2008://53.34524"/>
<rdf:li rdf:resource
=
"tag:broadcast.oreilly.com,2008://53.34508"/>
...
</rdf:Seq>
</items>
<item rdf:about
=
"tag:broadcast.oreilly.com,2008://53.34667">
<link>http://feeds.oreilly.com/
∼
r/oreilly/xml/
∼
3/487860677
/xforms-a-pause-for-reflection.html</link>
<dc:language>en</dc: language >
<dc:title>XForms, a pause for reflection</dc:title>
<dc:date>2008-12-17T18:05:12Z</dc:date>
<dc:creator>Philip Fennell</dc:creator>
<dc:description>The other day I had what could only be described as a
’Roy Scheider moment’, you know the bit in the film Jaws where the camera
tracks-in whilst zooming-out at the same time. Well, whilst debugging an
XForms enabled application, the Mozilla XForms plug-in had exposed the host
document, XForms and all, as the content of the empty xf:instance. How odd.
I mean, what good is that? That’s when it struck me in a Roy Scheider sort
of way; this was Reflection, the ability of a program to look at itself and
change its behaviour.</dc:description>
<dc:format>html</dc:format>
<dc:subject>xforms</dc:subject>
<dc:subject>xml</dc:subject>
<dc:subject>xrx</dc:subject>
</item>
...
</channel>
</rdf:RDF>
Summary
In this chapter you created two stylesheets, the first of which handled a typical document transformation
from XML to XHTML.
The second transform was a little more complex, involving two different schemas. You used an XSLT
version 2.0 stylesheet with XML output, and learned about using the
<xsl:for-each>
instruction to
handle repeating uniform data structures.
You used three methods to invoke your first stylesheet: the
<?xsl-stylesheet?>
processing instruction,
the Oxygen IDE, and the Saxon CLI.
Along the way, you learned about the main structural XSLT elements, defining output methods, match-
ing nodes in source documents, and selecting content to transform. You also encountered some common
XPath syntax, more of which is introduced in Chapter 2.
23