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

Re: Param Element

Subject: Re: Param Element
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 2 Jun 2005 21:25:35 +0100
Re:  Param Element
> One other dilemna:  in order for the transformation to not complain, I
> have to do a select on my parameter declerations which looks like:

> <xsl:param name="xm" select="/" />

If you pass in a value of this parameter then the select here is not
used, it is just a default value in case no parameter is supplied when
the stylesheet is called.



> But since the source is the exact same as the parameter xml, how does
> the select know which source to grab from? 

The select is always explictly into a specified node set that node set
will have nodes from one or more documents (usually just one).
in this case, you have select="/" so that selects the root node ancestor
of the current node. If this is at the top level of teh stylesheet the
current node is the root node of the main input document, so / selects
that node.

> Also, the above causes an
> overflow when the below transformation is processed,

most likely you have programmed an infinite loop, but it's hard to say
given the snippet you showed.


> so would it be correct to express select as:  select="in_proc"?
That's also correct (but dofferent of course) but still if you supply a
value to this parameter when you run the program it doesn't matter what
select expression you use here.

The templates that you show make no use of this parameter??

As written you will get a copy of the input doc except the top level
element will be duplicated as you generate an in_proc element in the
template for / and then apply templates to the child nodees (which is
the in_proc element in the source) which are copied.


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.