Re: Beginners question: Koala XSL-Engine and <xsl:process select>

Subject: Re: Beginners question: Koala XSL-Engine and <xsl:process select>
From: Steve Dahl <sdahl@xxxxxxxxxxx>
Date: Thu, 22 Oct 1998 14:17:39 -0400
Jeremy CALLES wrote:

> Martin Bernauer wrote:
> >
> > Hello,
> >
> > I have a XML document containing the following lines:
> >
> > <collection>
> >         <a>aaa</a>
> >         <b>bbb</b>
> >         <c>ccc</c>
> > </collection>
> >
> > and a XSL document that contains:
> >
> > <xsl:template match="collection">
> >         <P>
> >         <xsl:process select="c"/>
> >         <xsl:process select="b"/>
> >         <xsl:process select="a"/>
> >         </P>
> > </xsl:template>
> >
> > When I run the Koala XSL-engine with those two files i get the output
> >"aaabbbccc" but actually the output should be "cccbbbaaa" shouldn't it? What's
> >wrong?
> >
>
> Yes, you do it wrong. I explain:
>
> <collection> is the root of your document, so It couldn't be matched by
> an XSL processor (according to the WD 1.0) by is name.

That's not what I understand when I read the WD 1.0. According to Section 2.4.1,
which describes the root node, the root node in this case is not the <collection>
element, but is an "invisible" node whose only child element is the <collection>
element.

As such, the pattern "/" does not refer to the same node as "collection", but it
refers to the parent node of "collection".

Assuming that's correct, the output of the example should have been "cccbbbaaa",
which is the result produced by XT. I haven't tried any other public XSL processors
to see what they do.

- Steve Dahl
sdahl@xxxxxxxxxxx



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread