Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XSLT: importing, overriding and parameters

Reply
Thread Tools

XSLT: importing, overriding and parameters

 
 
Emil Karlen
Guest
Posts: n/a
 
      07-13-2004
Using the import-tag, a template appearing in the imported file, can be
extended in the importing file.
I am extending a template this way and in the main-file, inside the
template use "<apply-imports/> to trigger the template in the imported file.
Now, the imported template takes a parameter. How can I pass a parameter
to the template I am overriding (and triggering with <apply-imports/>).
I have tried
"
<apply-imports>
<with-param name="param_name">param!</xsl:with-param>
<apply-imports>
"
but it doesn't seem to work.
How do I do it?
Please help!

Best regards
Emil Karlén

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      07-13-2004


Emil Karlen wrote:

> Using the import-tag, a template appearing in the imported file, can be
> extended in the importing file.
> I am extending a template this way and in the main-file, inside the
> template use "<apply-imports/> to trigger the template in the imported
> file.
> Now, the imported template takes a parameter. How can I pass a parameter
> to the template I am overriding (and triggering with <apply-imports/>).
> I have tried
> "
> <apply-imports>
> <with-param name="param_name">param!</xsl:with-param>
> <apply-imports>
> "
> but it doesn't seem to work.


Looking at the XSLT 1.0 specification and the section about
xsl:apply-imports in

http://www.webreference.com/authorin...chap2/6/4.html
it seems there is no way with XSLT 1.0 to pass parameters with
apply-imports. Only XSLT 1.1 allows that and XSLT 2.0 will probably do:
http://www.w3.org/TR/xslt20/#apply-imports
I guess Saxon (http://saxon.sf.net/) implements that but I haven't tried.

--

Martin Honnen
http://JavaScript.FAQTs.com/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
skipping template parameters inside template parameters kito C++ 2 09-26-2010 12:04 AM
Overriding methods with parent object parameters Lew Java 5 07-09-2008 07:13 PM
Class Member Data and Member Function Parameters - Should Parameters Be Data Members? Jason C++ 2 05-13-2006 07:11 AM
does a "parameters"-parameter overwrite the "parameters"-object? Florian Loitsch Javascript 11 03-15-2005 03:33 PM
Servlet parameters different from the command line parameters? Jonck van der Kogel Java 2 05-26-2004 11:34 PM



Advertisments