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

Re: Context Assignment Question and New to list.

Subject: Re: Context Assignment Question and New to list.
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 15 Apr 2004 15:12:21 -0400
xsl for each assignment
Hi Blaine,

At 02:21 PM 4/15/2004, you wrote:
I am adding features to some existing sets of template functions. One of these functions (funcA for example) assume a context node .
My new template function (fucB) is fairly generic and takes in a node (say $cur_node), that it uses since I cannot depend on the context of the call to the template.


FuncB needs to make a call to FuncA.

Is there anyway to give $cur_node as the context for A?
Is there a function to "assign" context?

Sort of, though not a function, exactly. But if you can't rewrite FuncA to be context-neutral, you can work around it by switching context ad hoc, with a for-each (or even an apply-templates with a mode):


<xsl:template name="FuncB">
  <xsl:param name="cur-node" select="."/>
  ... whatever you do ...
  <xsl:for-each select="$cur_node">
    <xsl:call-template name="FuncA"/>
  </xsl:for-each>
  ... whatever else ...
</xsl:template>

I hope that helps,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

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.