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

  • Home
  • SEARCH
  • 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 3355198
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:21:57+00:00 2026-05-18T02:21:57+00:00

Hi is there away on how to declare a link(ie:http://www.google.com) as a variable and

  • 0

Hi is there away on how to declare a link(ie:http://www.google.com) as a variable and then using the variable for an else if?Something like this?

   <xsl:element name="a"> 
<xsl:attribute name="href">http://www.google.com</xsl:attribute>// first get the link
<xsl:choose>
<xsl:when test="http://www.google.com">
  Do something 1
</xsl:when>
<xsl:otherwise>
  Do something 2
</xsl:choose> 
</xsl:element>

Is this possible?What should i be looking at?

  • 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-18T02:21:57+00:00Added an answer on May 18, 2026 at 2:21 am

    is there away on how to declare a
    link(ie:http://www.google.com) as a
    variable and then using the variable
    for an else if?

    Use this code as a working example — of course you need to learn at least the basics of XSLT:

    <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
    
     <xsl:variable name="vLink" select="'http://www.google.com'"/>
    
     <xsl:template match="/">
      <xsl:choose>
        <xsl:when test="$vLink = 'http://www.google.com'">
          It is the Google link...
        </xsl:when>
        <xsl:otherwise>
         It is not (exactly) the Google link...
        </xsl:otherwise>
      </xsl:choose>
     </xsl:template>
    </xsl:stylesheet>
    

    when this transformation is applied on any XML document (not used), the wanted result is produced:

      It is the Google link...
    

    One can also use a global <xsl:param>. This can be set externally by the invoker of the transformation.

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

Sidebar

Related Questions

Is there a way to declare a variable as Nullable in c#? struct MyStruct
Outside of a for I declare a variable using var list; . I use
I hope I missed this in the docs. Is there a way to declare
Is there a way in Java to declare an enumeration whose values can be
Hi is there away to detect the length of a byte before I get
I am wondering if there is away (possibly a better way) to order by
is there an easy away to combine fields in awk? Specifically, I have lines
Is there an FTP browser hiding away in NetBeans 6.1? The help manual doesn't
Is there a way to hide private data members of a C++ class away
I noticed today (after ~8 years of happily hacking away at bash) that there

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.