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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:45:16+00:00 2026-05-14T00:45:16+00:00

I am relatively new to XSL and I think this is a basic question.

  • 0

I am relatively new to XSL and I think this is a basic question. So I better get my apologies in early!

Basically, I would like to use a value-of function. This will be in a template and I would like to pass part of the xpath as a parameter.

<xsl:variable name="TEST_VAR">"h:elementA/elementB"</xsl:variable>

... and then use the variable  (or passed in param) as all (or part) of the xpath:

<xsl:element name="transformedElement"><xsl:value-of select=$TEST_VAR/></xsl:element>

I would really like to have the xpath to be a mixture of string literals and the vlue of TEST_VAR.

Thanks in advance

  • 1 1 Answer
  • 3 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-14T00:45:16+00:00Added an answer on May 14, 2026 at 12:45 am

    What you want to do can’t be done. You cannot interpret plain strings as XPath expressions within an XSL transform.

    But you shouldn’t have to, anyway. By the looks of it you can replace your example with the following to get what you want:

    <xsl:variable name="TEST_VAR" select="h:elementA/elementB"/>
    <xsl:element name="transformedElement">
      <xsl:value-of select="$TEST_VAR"/>
    </xsl:element>
    

    But I suspect you’ve dumbed down your example to the point that it’s too simple to see what you actually want.


    Here’s a quick tip for using Stack Overflow: phrase your questions about what you actually need to do, and why you’re having trouble doing it. What you’ve done with this question is thought of a solution to your problem, and are asking Stack Overflow if it’s possible. It’s not, and since I can’t see your original problem I can’t help you more than I already have.

    Next time you ask a question, make sure to actually ask a question about the problem you’re facing, not the potential solution to the problem you’re facing. You’ll get better answers that way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm relatively new to web application programming so I hope this question isn't too
I am a relatively new programmer so this may be a really simple question
Relatively new to using database and for some reason I can't get this 'execute'
Relatively new to Cocoa here. This question is about NSFileHandle, but I got a
im relatively new to ROR, and would like some help with the following code.
Relatively new to Python.. I would like to know how to check if a
I am relatively new to programming so this may well sound like a stupid
I'm still relatively new to Python, so if this is an obvious question, I
Being relatively new to functional programming, I expend lots of energy wondering is this
Caveat: I'm relatively new to coding as well as TextMate , so apologies if

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.