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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:39:10+00:00 2026-05-28T16:39:10+00:00

I am trying to replace the different status indicators (e.g. Y or N) of

  • 0

I am trying to replace the different status indicators (e.g. Y or N) of a column “Status_Ind” with images. I would like to create “traffic lights” where:

– “Completed” is replaced with /img/green.jpg

– “In Progress” is replaced with /img/yellow.jpg

Input XML:

<Rowsets>
  <Rowset>
    <Columns>
      <Column Description="Status_Ind"/>
      <Column Description="Name"/>
    </Columns>
    <Row>
      <Status_Ind>Completed</Status_Ind>
      <Name>TASK1</Name>
    </Row>
    <Row>
      <Status_Ind>In Progress</Status_Ind>
      <Name>TASK2</Name>
    </Row>
  </Rowset>
</Rowsets>  

For the XSLT, I am using the code in https://stackoverflow.com/a/8841189/1130511

My attempt:

<xsl:template match="@Description='Status_Ind']">
  <xsl:choose>
    <xsl:when test="Completed">
      <img src="../img/green.jpg" />
    </xsl:when>
    <xsl:when test="In Progress">
      <img src="../img/yellow.jpg" />
    </xsl:when>
  </xsl:choose>
</xsl:template>
  • 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-28T16:39:11+00:00Added an answer on May 28, 2026 at 4:39 pm

    Easy with two dedicated templates:

    <xsl:template match="Status_Ind[. = 'Completed']">
      <img src="../img/green.jpg" />
    </xsl:template>
    
    <xsl:template match="Status_Ind[. = 'In Progress']">
      <img src="../img/yellow.jpg" />
    </xsl:template>
    

    This way you could simply do

    <xsl:template match="Row">
      <tr>
        <td><xsl:apply-templates select="Status_Ind" /></td>
        <!-- etc -->
      </tr>
    </xsl:template>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to replace all link href's in a large string with a different
I am trying to create a simple batch file that will replace a line
I am trying to create a for loop that will parse out different elements
I'm trying to replace several different characters with different values. For example, if I
I was trying to replace a container with different types of containers (I commented
I'm going crazy, spent a couple of hours trying different methods in replace values
Rather than trying to create tons of different pages on my website, I'm trying
I am trying to create a variable that performs a couple of different replacement
I have a t-sql statement like Replace(field,'\''','\') because i have two different results ''field1''
I am trying to replace occurances of a string in a few different steps,

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.