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 6080291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:02:39+00:00 2026-05-23T11:02:39+00:00

I have many functions that takes in one input, e.g.: <xsl:template name=F> <xsl:param name=input/>

  • 0

I have many functions that takes in one input, e.g.:

<xsl:template name="F">
    <xsl:param name="input"/>
    ... ...
</xsl:template>

To call the function, I need to write:

<xsl:call-template name="F">
    <xsl:with-param name="input" select="'jkljkljkl'"/>
</xsl:call-template>

This seems overly verbose. Since the function has only one parameter, why do we have to write the xsl:with-param node?

Is there a shortcut for calling one-parameter functions?

I want to be able to do something like this:

<xsl:call-template name="F" select-param="'jkljkl'"/>

It’s short and sweet and equally non-ambiguous (since there’s only one parameter). How can we call one-parameter functions in a short and sweet way?

Am looking for a solution in both XSLT 1.0 and XSLT 2.0.

  • 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-05-23T11:02:39+00:00Added an answer on May 23, 2026 at 11:02 am

    In XSLT 2.0 you can write your own functions by:

    • declaring your namespace
    • defining the function as a child of the transform root element, using xsl:function declaration.

    Example:

    <xsl:stylesheet version="2.0" 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:nTan="http://nTan.comr">
    
      <xsl:function name="nTan:Hello">
       <xsl:param name="string1"/>
        <xsl:value-of select="concat('Hello ',$string1)"/>
      </xsl:function>
    
      <xsl:template match="/">
        <xsl:value-of select="nTan:Hello('World!')"/>
      </xsl:template>
    
    </xsl:stylesheet>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Many people have argued about function size. They say that functions in general should
I'm trying to make a function that takes one of many classes that extends
here i have one function which is call many times in one application this
I have many structs (classes) and standalone functions that I like to compile separately
I have an old function that is called many times in my application. I
Lets assume i have a function that takes 32bit integer in, and returns random
I have a function that is very small, but is called so many times
I'm getting an weird error using queues/multiprocessing. I basically have a function that takes
I have this function below that takes a list of id's and searches the
I have a table-value function that takes an ID number of a person and

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.