INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Conditional Options based on what is in field, else call template to return something else.

Conditional Options based on what is in field, else call template to return something else.

Conditional Options based on what is in field, else call template to return something else.

(OP)
Hello,

Been a long time absent from any coding of any descript (do not know if that has been a good or bad thing =P I think probably bad).

Anyway I have a xsl that looks at just mapping a cost code, based on an unrelated area field.
However I only want to do this if the cost code in the original provision file is not one of two values:

IE Something like :

CODE

<!--Cost Code-->
<xsl:when test="../costCodeCode = '1000000.1'">799X.KN9003</xsl:when>
<xsl:when test="../costCodeCode = '1000000.2'">799X.KN9003</xsl:when>
<xsl:otherwise>
<xsl:call-template name="costCodeMap"
<xsl:with-param name="input" select="areaName"/>
</xsl:call-template>
</xsl:otherwise>
</choose>
<xsl:text>,</xsl:text>

<xsl:template name="costCodeMap">
<xsl:param name="input"></xsl:param>
<xsl:choose>
<xsl:when test - "$input = 'Blergh1'">799X.KN0001<xsl:when>
<xsl:when test - "$input = 'Blergh2'">799X.KN0002<xsl:when>
<xsl:when test - "$input = 'Blergh3'">799X.KN0003<xsl:when>
<xsl:when test - "$input = 'Blergh4'">799X.KN0004<xsl:when>
<xsl:when test - "$input = 'Blergh5'">799X.KN0005<xsl:when>
<xsl:otherwise>nca</xsl:otherwise>
<xsl:choose>
</xsl:template> 

It is an exiting translation, however I am trying to put the exception in of occasions where I do not want it to use the alternative selection method derived from a different field. IE if the cost code supplied in the provision field is either '1000000.1' or '1000000.2' then I want it to put in a particular value... otherwise it is to do the additional based on the template?

Apologies if this seems long winded, or if I am not quite describing things right.. posting in the wrong location etc.
As say, been away from any real form of scripting for a while now.
And completely new at xsl (
Please bare with =(

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close