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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:48:25+00:00 2026-06-15T18:48:25+00:00

I have a simple question. How do you combine a path from two template

  • 0

I have a simple question. How do you combine a path from two template parameters? I would like to do something like that:

<xsl:template match="*[namespace-uri()='show:show']">
<xsl:param name="arg1"/>
<xsl:param name="arg2"/>
<tr>
  <td>
    <xsl:value-of select="concat($arg1,$arg2)"/>
  </td>
</tr>  

to get path like: arg1/arg2 but it doesn’t work. How can I do that properly?
or can you do sth like

<xsl:value-of select="path/path/$arg2"/>  

?
arg1 is complete path from root and arg2 is single element name.

  • 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-15T18:48:25+00:00Added an answer on June 15, 2026 at 6:48 pm

    To build path expressions as strings and then evaluate them you need an extension function (at least in XSLT 1.0 and 2.0), there’s nothing in the core spec to support it but most processors provide a suitable function. The expression

    <xsl:value-of select="concat($arg1,'/',$arg2)"/>
    

    would result in a string containing the string value of arg1, a slash, and the string value of arg2. But if arg1 is a node set and you restrict arg2 to be just an element name then you can do something like this

    <xsl:value-of select="$arg1/*[local-name() = $arg2]"/>
    

    (or copy-of as appropriate) and call the template like

    <xsl:with-param name="arg1" select="/path/to/interesting/stuff" />
    <xsl:with-param name="arg2" select="'elementname'" />
    

    If you wanted to allow for arg2 to name an attribute rather than an element use

    $arg1/@*[.....]
    

    Or to allow it to be either (assuming the target of arg1 doesn’t have an attribute and a child element with the same name)

    $arg1/node()[......]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a simple question: i have this var: $v = 24000,1500,1500,1500,1500,1500,; i would
i have a simple question, there is a function with parameter emp_id that opens
I have a simple question and that is how do you check if an
I have a really simple question that I cannot find a straightforward answer for.
pretty simple question, can't quite fig. it out. I have 2 js array's that
I have simple question. User supplies URL to my PHP script where I fetch
I have simple type Question : public class Question { public string[] Tags {
I have a simple question: how exactly are array variables such as $_SESSION and
I have a simple question. I'm trying to get a list of the indicators
I have another simple question about Node. I'm trying to make a simple http

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.