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

Re: template matching, passing parameters.

Subject: Re: template matching, passing parameters.
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 30 Mar 2004 11:59:48 -0500
parameterized template matching
Hi Chris,

You can certainly apply-templates to a node higher in the tree than your current node; when you do, as always, the current node and context shift to the selected node. And you can pass parameters when doing this.

When you do this, however, you probably want to use a mode in some fashion to avoid an infinite processing loop.

You can also pass a node-set (a higher node or any nodes at all) into a named template as a parameter when you call it, and base the operations in the named template on the parameterized node(s) rather than on the current node. So there actually is a solution lurking there.

I hope this helps. Ask again if you need to see syntax.

Cheers,
Wendell

At 10:42 AM 3/30/2004, you wrote:
Hello,

Im not sure how to explain my question, but i will give it a try.
Suppose you have a template wich matches with some elements of your sourcetree (of the input xml file). There you calculate something wich you put in a variable or parameter. Now you want to pass this value to a template who matches with elements higher in the sourcetree then the previous elements. And then use that value at that (high) position.


Basically i want to pass a parameter from a template matching elements deep in a tree to a template matching elements higher in the tree and also change the current node to the higher element.
But Im not sure if this is possible.


I know that if you use call-template, you still stay at the same node from the template where you perform the call so this is probably not the solution...


======================================================================
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.