Description
Annotation of above start-tag:
* The root element of an XSLT program is either a
<stylesheet> element or a
<transform> element; they're interchangeable.
* The @version attribute is the version of the XSLT language that
you are going to be using; use 1.0 if you need the transformation to be in-the- browser,
and
2.0 if you need fancy features. We used 2.0 in class.
* The @xpath-default-namespace attribute contains the namespace
that is presumed on element tests in XPaths. In this case, the value is the TEI P5
namespace. I.e., this tells us that by default the path 'div/p' is talking about a
TEI p in
a TEI div (as opposed to an XHTML p in an XHTML div, e.g.). You can think of this
as the
namespace of the input document.
* The other two lines are namespace declarations. The first says that any element
that
bears the prefix "xsl:" is in the XSLT namespace (thus the XSLT
<stylesheet> element itself is expressed as "xsl:stylesheet").
The second says that elements that do not have a namespace prefix are in the XHTML
namespace. We use this for literal results elements (e.g., when we just write
"<p>hello</p>" in a template). Thus
you can think of it as the namespace of the output document.
* EXTRA INFO: The namespace declarations are *not* attributes, even though they look
like attributes. What's the difference? For one thing, they are not available on the
attribute:: axis (abbreviated "@"). So if you enter "/xsl:stylesheet/@xmlns" into
oXygen's
XPath search box, you'll find it is a valid XPath that returns no results. In fact,
as you
try to type it, you will probably find that when you get to typing the "@", oXygen
auto-completes with @version and
@xpath-default-namespace (which are attributes) but not
@xmlns or @xmlns:xsl (which are not). On the
other hand, if you enter "/xsl:stylesheet/namespace::node()", you should get a sequence
of 3
items.