Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9027129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:41:03+00:00 2026-06-16T06:41:03+00:00

I have a XSLT. which calls a function that returns a string. Like this:

  • 0

I have a XSLT. which calls a function that returns a string. Like this:

<xsl:param name="mystr" select="myStrfunc()"></xsl:param>

it also calls a XML template like so:

 <li>
<xsl:call-template name="myLinks">
<xsl:with-param name="link" select="$links/link[@Id='link1']" />
<xsl:with-param name="mystr"/>
</li>

the xml template snippet looks like this:

    <link Id="link1">
     <a href="" text="click" />
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
how can I access the parameter mystr declared in xslt here??
    </link>

how can I access parameter mystr in the xml file?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T06:41:04+00:00Added an answer on June 16, 2026 at 6:41 am
    <li>
      <xsl:call-template name="myLinks">
        <xsl:with-param name="link" select="$links/link[@Id='link1']" />
        <xsl:with-param name="mystr"/>
    </li>
    

    This is malformed XML — the element xsl:call-template isn’t closed.

    Most probably you wanted:

    <li>
     <xsl:call-template name="myLinks">
       <xsl:with-param name="link" select="$links/link[@Id='link1']" />
       <xsl:with-param name="mystr"/>
     </xsl:call-template/>
    </li>
    

    This invokes the template named "myLinks" and passes to it two parameters, named: "link" and "mystr".

    However, there is no value (in a select attribute or in the body of the element) defined for the "mystr" parameter.

    If you want to provide a value for the parameter — for example the result of executing a function, this can be done as follows:

    <li>
     <xsl:call-template name="myLinks">
       <xsl:with-param name="link" select="$links/link[@Id='link1']" />
       <xsl:with-param name="mystr" select="myStrfunc()"/>
     </xsl:call-template/>
    </li>
    

    Then in the body of the called template, the value of the parameter can be accessed simply by referencing it:

    <link Id="link1">
     <a href="" text="click" />
     <xsl:value-of select="$mystr"/>
    </link>
    

    Or, if you need to use $mystr to generate the value of the href attribute, then do:

    <link Id="link1">
     <a href="{$mystr}" text="click" />
    </link>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this XSLT 2.0: <xsl:stylesheet version=2.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform> <xsl:output indent=yes/> <xsl:strip-space elements=*/> <xsl:template match=node()|@*>
I have a XML which works with an XSLT file that transforms the XML
I have a chained XSLT 2.0 transformation scenario (using saxon), like this: - I1.xml
I have an XSLT stylesheet like the following: <?xml version=1.0 encoding=utf-8?> <xsl:stylesheet version=2.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform
I have an xml datasource which looks like this: <dsQueryResponse> <Department> <Rows> <Row dept=HR
I have been using the following xpath selection in xpath 1.0 <xsl:variable name=id><xsl:value-of select=./@id
I have a XSLT sample copied straight from http://www.w3schools.com/xsl/xsl_transformation.asp , which I can't seem
I have an XSLT script which I would like to number things sequentially each
I have an xml file that looks like this: <args> <sometag value=abc /> <anothertag
I have some XSLT which is used to select text which has a particular

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.