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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:11:37+00:00 2026-06-02T09:11:37+00:00

Unable to succeed in passing parameters in xsl (1.0) for . It seems that

  • 0

Unable to succeed in passing parameters in xsl (1.0) for . It seems that one cannot dynamically modify the content of the ‘select’. Below is an attempt that does not throw an error but fails to recognise the $entity parameter:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output cdata-section-elements="" encoding="UTF-8" indent="yes" method="xml" omit-xml-declaration="yes"/>   
    <xsl:param name="entity">CreditController[]</xsl:param>
        <xsl:template match="/">
            <xsl:element name="variable">
                  <xsl:attribute name="type">NameValuePair[]</xsl:attribute>
                      <xsl:apply-templates select="variable/*[@type='$entity']/item"/>                      
            </xsl:element>
    </xsl:template>

    <xsl:template match="item">                 
            <xsl:element name="item">
            <xsl:attribute name="type">NameValuePair</xsl:attribute>
            <xsl:element name="value">
                <xsl:attribute name="type">String</xsl:attribute>
                <xsl:value-of select="Code"/>
            </xsl:element>
            <xsl:element name="name">
                <xsl:attribute name="type">String</xsl:attribute>
                <xsl:value-of select="Code"/>-<xsl:value-of select="Value"/>
            </xsl:element>
            </xsl:element>
    </xsl:template>

</xsl:stylesheet>

Thanks in advance. Other posts seemed to recommend using and also setting ‘Mode’ attribute of the element. I did not win with either of these.

Replacing the entity variable with the string literal ‘CreditController[]’ works as expected.

  • 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-02T09:11:38+00:00Added an answer on June 2, 2026 at 9:11 am

    In your XPath you surround your $entity with quotes, making it the string literal $entity and not a variable to be expanded.

    Remove the quotes:

    <xsl:apply-templates select="variable/*[@type=$entity]/item"/>                      
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm unable to execute the following prepared statement , PREPARE stmt FROM 'SELECT sb.id,sb.category,sb.make,sb.name,sb.pic,rs.slot
Two hopefully minor questions regarding CoreData that I've been unable to find answers to:
Trying to install VS2012 utlimate RC, however I am unable to succeed as every
Unable to find a SQL diff tool that meets my needs, I am writing
I'm getting strange results from the FusionTable API. Specifically, it seems unable to handle
I have one folder that contains more number of xml files and extract some
REVISED QUESTION I have revised the original question (as seen below) so that I
Unable to cast object type System.Collections.Generic.List 1[NorthwindMVC3.Models.Product] to the type ofSystem.Collections.Generic.IEnumerator 1[NorthwindMVC3.Models.Product].\ public IEnumerator<Product>
Im unable to start new project in a virtualenv. This is what i did
Error: Unable to read data from the transport connection: A blocking operation was interrupted

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.