Re: [xsl] [XSL] Two "Philisophical" questions about the language

Subject: Re: [xsl] [XSL] Two "Philisophical" questions about the language
From: "Stuart A. Yeates" <syeates@xxxxxxxxx>
Date: Mon, 19 Jan 2009 17:02:36 +1300
On 1/18/09, G. Ken Holman <gkholman@xxxxxxxxxxxxxxxxxxxx> wrote:
> At 2009-01-17 12:23 +0100, Alain wrote:
>>My second one might be easier!
>>
>>Let's say I have an XML like this
>>
>><?xml version="1.0">
>><root>
>>  <!-- Any number of nodes here -->
>></root>
>>
>>As a valid XML document can have only one "main" node,
>
> Called the "document element".
>
>>what is the architectural and practical difference between
>>
>><xsl:template select="/">
>>
>>and
>>
>><xsl:template select="/root">
>
> First, it would be match="/" and match="/root", and needing to match
> on the document node is important to access the XML prologue and any
> content after the document element in the instance:
>
> <?xml version="1.0">
> <?xml-stylesheet type="text/xsl" href="over-there.xsl">
> <?owner jsmith>
> <root>
> </root>
> <!--copyright notice here-->
>
> The root node in the above document has 4 child nodes.

There is also the case of XML schemas which can have different root
nodes. For example in TEI (http://www.tei-c.org/) we have both TEI
(containing a single text) and teiCorpus (containing a corpus of
texts). "/" will match either of these. "/teiCorpus" or "/TEI" only
match one or the other.

cheers
stuart

Current Thread