[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Beginners question: Koala XSL-Engine and <xsl:process se

Subject: RE: Beginners question: Koala XSL-Engine and <xsl:process select>
From: Ed Nixon <ed.nixon@xxxxxxxxxxxxxxxxx>
Date: Thu, 22 Oct 1998 16:45:00 -0400
xsl process
Here is a quote from Frank Boumphrey's XSL tutorial (found at: 
Http://www.hypermedic.com/style/xsl/index.htm )

'Note that the root is not the same as the root element, which can be matched 
by name, it comes before this. It is really a fiction. The reason for the 
distinction is that if we named the root element, e.g. <xsl:template 
match="xdoc"> and then used <process-children/> the root node would not be 

"xdoc" is simply the name of the example root element in the tutorial.

-----Original Message-----
From:	Tyler Baker [SMTP:tyler@xxxxxxxxxxx]
Sent:	Thursday, October 22, 1998 3:33 PM
To:	xsl-list@xxxxxxxxxxxxxxxx
Subject:	Re: Beginners question: Koala XSL-Engine and <xsl:process select>

Steve Dahl wrote:

> 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? 
> > >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 
> which describes the root node, the root node in this case is not the 
> element, but is an "invisible" node whose only child element is the 
> element.
> As such, the pattern "/" does not refer to the same node as "collection", but 
> refers to the parent node of "collection".
> Assuming that's correct, the output of the example should have been 
> which is the result produced by XT. I haven't tried any other public XSL 
> to see what they do.

What is the use in this?  In XML there is only one root element node (the 
element) so as far as processing is concerned, it seems pretty silly to have an 
invisible element node as the parent of the document element since there will 
always be
one and only one document element.  Furthermore, this makes you have to always
explicitly refer to the document element in any match or select pattern, .e.g.

<xsl:template match="/">
<xsl:process select="collection/a"/>
<xsl:process select="collection/b"/>
<xsl:process select="collection/c"/>

Making stylesheet designers do this makes no sense in my opinion.  The other
alternative is the following.  Can someone please explain to me the rationale 
of why
the document element is NOT the root node.

<xsl:template match="collection">
<xsl:process select="a"/>
<xsl:process select="b"/>
<xsl:process select="c"/>


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

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

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.