XSLT: importing, overriding and parameters

E

Emil Karlen

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
 
M

Martin Honnen

Emil said:
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/authoring/languages/xml/insidexslt/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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top