otmfaqForumsBlogsRegister
FAQMembers ListCalendarToday's PostsSearch


 Subscribe Blogs:RSS
 Subscribe Forums:RSS
OTMFAQ Home
OTMFAQ Blogs
OTMFAQ Forums
OTMFAQ Tutorials

OTM SIG
MavenWire


Branding, Screen Sets, XSL/CSS and Translations Customizing and Branding the UI of OTM / G-Log for your site, using Custom Screen Sets, Menu Managers, XSL/CSS customizations, Translations and more.

Tags: , ,

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old October 3rd, 2007, 12:40
Junior Member
 
Join Date: Mar 2007
Location: Chicago
Posts: 20
Thanks: 2
Thanked 1 Time in 1 Post
Groans: 0
Groaned at 0 Times in 0 Posts
Rep Power: 0
tangfj is on a distinguished road
Tender Stylesheets - Multiple xsl:when conditions

Hello everyone,

I have a situation here where I would like to send a different message when a particular condition is met.

For example:

if a shipment refnum value = ABC
then use template A

or if a shipment refnum value = DEF
then use template A

or if a shipment refnum value = GHI
then use template A

otherwise use template B

So far I have been able to get it to work with one condition...

if shipment ship unit item tag = ABC
then use template A

otherwise use template B

I have not been able to get it working with multiple conditions, however. In my code for multiple conditions I'm checking on shipment ship unit item tags and shipment refnum values.


Below is an excerpt from my XSL code. Anyone know why this isn't working for me? It seems to be going straight to the "otherwise" statement when I know that it should be using one of the "when" statements.

<xsl:choose>
<xsl:when test="/notify/Blob/xml/TenderOffer/Shipment/ShipUnit/ShipUnitContent/ItemQuantity/ItemTag2='ABC'">
<xsl:call-template name="tenderHeader">
<xsl:with-param name="mes" select="string('message.TenderResponseNotNeeded')"/>
<xsl:with-param name="incURL" select="$includeURL"/>
<xsl:with-param name="incReplyBy" select="string('N')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="/notify/Blob/xml/TenderOffer/Shipment/ShipmentHeader/ShipmenRefnumQualifierGid/ShipmentRefnumValue='ABC'">
<xsl:call-template name="tenderHeader">
<xsl:with-param name="mes" select="string('message.TenderResponseNotNeeded')"/>
<xsl:with-param name="incURL" select="$includeURL"/>
<xsl:with-param name="incReplyBy" select="string('N')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="/notify/Blob/xml/TenderOffer/Shipment/ShipmentHeader/ShipmenRefnumQualifierGid/ShipmentRefnumValue='DEF'">
<xsl:call-template name="tenderHeader">
<xsl:with-param name="mes" select="string('message.TenderResponseNotNeeded')"/>
<xsl:with-param name="incURL" select="$includeURL"/>
<xsl:with-param name="incReplyBy" select="string('N')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="/notify/Blob/xml/TenderOffer/Shipment/ShipmentHeader/ShipmenRefnumQualifierGid/ShipmentRefnumValue='GHI'">
<xsl:call-template name="tenderHeader">
<xsl:with-param name="mes" select="string('message.TenderResponseNotNeeded')"/>
<xsl:with-param name="incURL" select="$includeURL"/>
<xsl:with-param name="incReplyBy" select="string('N')"/>
</xsl:call-template>
</xsl:when>
<xsltherwise>
<xsl:call-template name="tenderHeader">
<xsl:with-param name="mes" select="$message"/>
<xsl:with-param name="incURL" select="$includeURL"/>
<xsl:with-param name="incReplyBy" select="$includeReplyBy"/>
</xsl:call-template>
</xsltherwise>


Thanks in advance for the help!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old October 3rd, 2007, 16:36
Junior Member
 
Join Date: May 2007
Location: Singapore
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
Groans: 0
Groaned at 0 Times in 0 Posts
Rep Power: 0
satya_m is on a distinguished road
Re: Tender Stylesheets - Multiple xsl:when conditions

Hi,

I don't think multiple <xsl:when>s with one <xsltherwise> will work. I haven't used or seen multiple when conditions with single otherwise in GC3.

Have you tried something like this?

if shipment refnum value = ABC or shipment refnum value = DEF or shipment refnum value = GHI

then use template A

otherwise
use template B


I have implemented my conditions this way manytimes and it works fine for me.

Also, please check if your xpaths (eg. /notify/Blob/xml/TenderOffer/Shipment/ShipUnit/ShipUnitContent/ItemQuantity/ItemTag2) are fetching the correct values.

Let me know if you need more info.


Regards,
Satya
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old October 3rd, 2007, 17:08
Junior Member
 
Join Date: Mar 2007
Location: Chicago
Posts: 20
Thanks: 2
Thanked 1 Time in 1 Post
Groans: 0
Groaned at 0 Times in 0 Posts
Rep Power: 0
tangfj is on a distinguished road
Re: Tender Stylesheets - Multiple xsl:when conditions

Yes you are right my xpath was wrong... I'm still waiting to restart to test though.

Satya, would you mind elaborating on how "if shipment refnum value = ABC or shipment refnum value = DEF or shipment refnum value = GHI" would look in an XSL file? I'm an XSL novice so I appreciate the help!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old October 3rd, 2007, 18:40
Junior Member
 
Join Date: Mar 2007
Location: Chicago
Posts: 20
Thanks: 2
Thanked 1 Time in 1 Post
Groans: 0
Groaned at 0 Times in 0 Posts
Rep Power: 0
tangfj is on a distinguished road
Re: Tender Stylesheets - Multiple xsl:when conditions

Ok nevermind, I got it working today. It appears that multiple <xsl:when>s with one otherwise, does work in OTM xsl files. Thanks for the help!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Releases shahidali12 Order Processing 4 March 3rd, 2008 13:17
Bulk Allocation- How to insert conditions RPANREDDY Settlement 1 December 17th, 2007 02:51
Stylesheets in 5.5 Rajashree Branding, Screen Sets, XSL/CSS and Translations 1 August 30th, 2007 19:12
java.io.FileNotFoundException on Stylesheets acuartero Installation and Upgrades 2 August 29th, 2007 21:44
[SOLVED] Spot Tender/Broadcast Tender Process Within OTM Dilday Stephen Email List Archive 0 February 8th, 2007 19:11



All times are GMT. The time now is 12:53.
Copyright © 2008, Open Book Solutions LLC. All rights reserved.

Sponsored by MavenWire - MavenWire.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37