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

Re: Some general questions...

Subject: Re: Some general questions...
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 14 Feb 2002 14:21:53 +0000
some general questions
Hi Ragulf,

> Problem is, I can't find anywhere in the code where "Something" is
> called (except in the template itself). I would guess that the
> function/template will never be used in the stylesheet, but is there
> perhaps another way of invoking a called template than <xsl:call
> template name="Something"> ..?

No - the only way that you can call a template by name is through
xsl:call-template. Though you should make sure that the stylesheet is
never imported or included into another stylesheet that *does* make
use of the Something template before you get rid of it.

> Is it possible to load an XSL stylesheet using the command
> LoadXML(string) the same way as with an XML document.

Yes, you should be able to do it without problems. Make sure that the
DOM into which you're loading the stylesheet isn't trying to validate
the stylesheet or do anything funny like that. After your attempt to
load the XSLT stylesheet as a string, have a look at the parseError on
the DOM object to see whether that tells you anything helpful about
why the load is failing.

> When do I have to pass what I want as parameters and when can I
> refer to a variable that has been declared not globaly but within an
> applied template?

If a variable is defined within a template, it is only ever available
within that template. It is never available within any other templates
that you apply or call from the template in which you define the
variable. Likewise, a variable is never available within the template
that called or applied the template that defines the variable.

So you *always* have to pass values as parameters into other
templates (or define the variable as a global variable). And to 'pass'
a value back to a calling template, you have to make the value the
result of the template.

I hope that clears things up,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.