Page 176 - Building Digital Libraries
P. 176
Sharing Data—Harvesting, Linking, and Distribution
nodes to be processed. XSLT processing instructions are defined through
a namespace. Within an XML document, the namespace is a method that
is used to define a set of tags through the use of an identifying URI. XSLT
defines the following namespace URI, www.w3.org/1999/XSL/Transform,
to define for the XML/XSLT parser a valid set of processing instructions
that can be used to perform an XSLT transformation.
XSLT offers a simple method for transforming XML documents to other
formats, be they another XML document or documents of another type like
HTML. XSLT offers the ability to separate the display or transformation
instructions from the bibliographic content, allowing the bibliographic
content to be clearer and more portable. Let’s look at a very simple XML
document and how this document might be transformed using XSLT.
<?xml version=“1.0” encoding=“utf-8” ?>
<ZooTrip>
<photo title=“Standing at the Elephant’s pen” filename=“http://oregonstate.edu/~reeset/
presentations/xml/look_elephant.jpg”>
<animals />
<people>
<name>Kenny Reese, Terry Reese</name>
</people>
</photo>
<photo title=“Walking Elephant” filename=“http://oregonstate.edu/~reeset/presentations/xml/
elephant_boy.jpg”>
<animals>
<name>Elephant</name>
</animals>
<people>
<name>Kenny Reese, Terry Reese</name>
</people>
</photo>
<photo title=“Feeding the birds” filename=“http://oregonstate.edu/~reeset/presentations/xml/bird1
.jpg”>
<animals>
<name>Lorikeets</name>
</animals>
<people>
<name>Kenny Reese, Terry Reese</name>
</people>
</photo>
<photo title=“Driving in the Savannah” filename=“http://oregonstate.edu/~reeset/presentations/xml/
truck.jpg”>
<animals />
<people>
<name>Kenny Reese, Terry Reese</name>
</people>
</photo>
</ZooTrip>
The above XML document is a simple marked-up document detailing a
trip to the zoo. In the document, each object is grouped using a “photo”
tag, which is enhanced with attributes providing information about the title
and file name of the photo. Beneath the “photo” tag are children elements
that provide some additional information about the content of the photo,
161