XSLT: importing, overriding and parameters

Discussion in 'XML' started by Emil Karlen, Jul 13, 2004.

  1. Emil Karlen

    Emil Karlen Guest

    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
    Emil Karlen, Jul 13, 2004
    #1
    1. Advertising

  2. 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/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.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jul 13, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stylus Studio
    Replies:
    0
    Views:
    658
    Stylus Studio
    Aug 3, 2004
  2. plb
    Replies:
    2
    Views:
    347
  3. Jason
    Replies:
    2
    Views:
    506
    Jonathan Mcdougall
    May 13, 2006
  4. Matt_D
    Replies:
    5
    Views:
    274
    Matt_D
    Dec 10, 2007
  5. Lew
    Replies:
    5
    Views:
    663
    Tom Anderson
    Jul 9, 2008
Loading...

Share This Page