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

Re: Can i use apply-templates to match a xsl:template

Subject: Re: Can i use apply-templates to match a xsl:template eleme nt?
From: "Aron Bock" <aronbock@xxxxxxxxxxx>
Date: Sat, 19 Mar 2005 16:17:51 +0000
xsl document apply templates
Chris,

Going by the subjectline, if you want a template in an xstl stylesheet to find other elements in the same stylesheet, do something like the following:

   <xsl:template match="/">
       <xsl:for-each select="document('')/*/xsl:template">
           <xsl:value-of select="@match"/>
       </xsl:for-each>
   </xsl:template>

Here the document() function, with an empty-string, returns the containing xslt document...which is an xml document, and which we navigate as usual.

Needing to seach for an xsl:template within the same stylesheet can be useful if one od the "templates" actually holds some soft of mapping or lookup information which is best kept in-situ in the xslt document rather than in a separate file.

FYI, document('/') returns the main input xml document in similar fashion (at least under xalan).

Regards,

--A

From: Chris <phatfish@xxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Can i use apply-templates to match a xsl:template eleme nt?
Date: Sat, 19 Mar 2005 13:54:20 +0000


Thanks very much for the help. I dont think thats quite what i wanted
Maria, but i will look and see what you did, and check if it is any
help to me.

You see what im trying to do jay, but i think im confusing myself :) I
will make another thread that will hopefully be clearer and more
productive.

Thanks
On Fri, 18 Mar 2005 11:19:56 -0600, JBryant@xxxxxxxxx <JBryant@xxxxxxxxx> wrote:
> <xsl:apply-templates match="releasepage"/>
>
> should be
>
> <xsl:apply-templates select="releasepage"/>
>
> Rushing too much today. Sorry.
>
> Jay Bryant

_________________________________________________________________
Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/


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.