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

Re: Question

Subject: Re: Question
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 03 Feb 1999 17:41:57 -0500
xsl constants
At 99/02/03 15:12 -0600, Paul Prescod wrote:
>What I need is to do something like this:
>
><xsl:template match="METHODREF">
>   <xsl:value-of select="ancestor(CLASS)/METHOD[@name=***]">
></xsl:template>
>
>The problem is that at the point of the *** I've lost the context of the
>METHODREF and don't have a way to get its @name anymore.

James posited a solution to one of my problems that would solve your problem:

At 99/01/18 09:33 +0700, James Clark wrote:
>"G. Ken Holman" wrote:
>
>> (4) - so, I need to walk the source tree at each level of interest and
>> determine if where I am (or my ancestor module is) is where I was before I
>> started walking, and at each step render different information calculated
>> from where I am walking:
>
>If XSL had local constants/variables, you could express exactly that
>   ...
>   <xsl:constant name="current-node-name" value="{@id}"/>
>   <xsl:constant name="current-module-name"
>                value="{ancestor-or-self(intro|module|exit)/@id}"/>
>   <xsl:for-each select="/course/intro|/course/module|/course/exit">
>     <xsl:choose>
>       <xsl:when test="@id=constant(current-module-name)">
>          <!-- render green button without hyperlink -->


I suppose your solution would then be:

<xsl:template match="METHODREF">
  <xsl:constant name="where-am-i" value="{@name}"/>
  <xsl:value-of select="ancestor(CLASS)/METHOD[@name=constant(where-am-i)]"/>
</xsl:template>

I don't think it can be done today.  I'm hoping to see this feature added
to XSL.

Is there anything preventing you from using ID/IDREF instead?  That would
work fine with today's XSL.

.......... Ken

--
G. Ken Holman         mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.  http://www.CraneSoftwrights.com/s/
Box 266,                                V: +1(613)489-0999
Kars, Ontario CANADA K0A-2E0            F: +1(613)489-0995
Training:   http://www.CraneSoftwrights.com/s/schedule.htm
Resources: http://www.CraneSoftwrights.com/s/resources.htm
Shareware: http://www.CraneSoftwrights.com/s/shareware.htm
Next XSL Training:      X-Tech:1999-03-07  WWW8:1999-05-11


 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.