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

Re: Newbie Needs Help

Subject: Re: Newbie Needs Help
From: Steve Dahl <sdahl@xxxxxxxxxxx>
Date: Thu, 17 Dec 1998 13:34:53 -0500
steve dahl
Oren Ben-Kiki wrote:

> Robert W. Hackenfort <rhackenfort@xxxxxxxxxx> wrote:
>
> >Just starting out in XML and XSL and tried to do a very simple document.
> >
> >The XML is:
> >
> ><?xml version="1.0"?>
> ><?xml:stylesheet type="text/xsl" href="test.xsl"?>
> >
> ><greeting>Hello XSL!</greeting>
> >
> >and the XSL is:
> >
> ><xsl:stylesheet
> >xmlns:xsl="http//www.w3.org/TR/WD-xsl"
> >xmlns:fo="http//www.w3.org/TR/WD-xsl/FO" result-ns="fo">
> > <xsl:template match= "greeting">
> > <fo:block color="red" font-size="16pt">
> >   <process-children/>
> >  </fo:block>
> > </xsl:template>
> ></xsl:stylesheet>
>
> Which produces a blank result, since matching on the top-level element can
> only done by using match="/" regardless of the actual element type which
> appears there. "It made sense at the time" - it probably still does when
> viewing it in the right way. It makes for an excellent FAQ question (if we
> had a FAQ, that is) - it seems every new XSL user goes through finding this
> out the hard way.
>
> Share & Enjoy,
>
>     Oren Ben-Kiki

On the contrary. The top-level element is *not* matchable by the "/" pattern.
According to the August 18th draft:

> 2.4.1 Root Node
>
> The root node is the root of the tree. It does not occur anywhere else in the
tree.
> It has a single child which is the element node for the document element of
the document.

So the root node is not the top-level element, but is the parent node of the
top-level element--in other words, the root node is the Document node. The "/"
pattern, in a conforming XSL processor, selects the Document, not the
<greeting> element.

Quite probably, the main problem here is that <process-children/> needs to be
replaced with <xsl:apply-templates/>, as well as the fact that IE5b2 doesn't
implement the FO part of XSL.



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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.