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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:39:22+00:00 2026-06-01T01:39:22+00:00

Could xsl:variable be defined twice with same name in same scope. For code similar

  • 0

Could xsl:variable be defined twice with same name in same scope.
For code similar to the following:

<xsl:template match="\">
   <table>
   <tr><td>
     <xsl:variable name="status" select="normal"/>
   </td></tr>
   <tr><td>
     <xsl:variable name="status" select="failed"/>
   </td></tr>
   </table>
</xsl:template>

Maybe it depends on browse’s type. What is the standard?

  • 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-01T01:39:23+00:00Added an answer on June 1, 2026 at 1:39 am

    First, two variables never have the same scope. Even if they are both global, the scope of the variable excludes its own select expression, so the scope of the two variables is different.

    Second, in your example the scope of the two variables isn’t even overlapping. Each variable is confined to its own containing td element.

    For two global variables, the rule is that you can have two variables with the same name provided they have different import precedence, in which case all references are treated as references to the one with higher precedence.

    If one variable is local and the other is global, then the local variable wins if it is in scope.

    If you have two local variables with overlapping scope, this is an error in XSLT 1.0, but is permitted in XSLT 2.0; within the overlap area, the variable with smaller scope wins.

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

Sidebar

Related Questions

I have the following XSLT code that almost does what I want: <xsl:variable name=scoredItems
Assume I have the following temp documents: <xsl:variable name=emc> <people> <person id=1> <name>Jim</name> </person>
So here is my current code: <xsl:variable name=address> <xsl:value-of select=concat(/node1/node2/address.node/street, /node1/node2/address.node/city, /node1/node2/address.node/zip) /> </xsl:variable>
I am using the below way to assign value to a variable. <xsl:variable name=NewValue>
Basically I have a small template that looks like: <xsl:template name=templt> <xsl:param name=filter />
Could someone help me with this. I need in C# to remove node xsl:variable
In my XSLT file. I use the document() function <xsl:variable name=Publicity select=document('./publicity.xml') /> and
I'm writing a stylesheet in xsl (version 2.0) I want to know how could
I have a long web url in my xsl variable. eg. @url = http://stackoverflow.com/questions/ask/2434/35454
i have the following xslt sheet: <?xml version=1.0 encoding=UTF-8 ?> <xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform version=1.0> <xsl:variable

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.