xml - if else condition is not working in XSLT? -
i trying try this link else if
condition without sucess.
my code
<xsl:choose> <xsl:when test="//./actionparams/@txt_sid = '110'"> <xsl:for-each select="ext"> <config type="2" localserver="newxyz.com" liveserver="newxyz.com" httpuri="/etmailregistration/ok/unsubfrmapp?sendmail=1" params="txt_id,txt_sid" readtimeout="39000" retry="3"/> </xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:for-each select="ext"> <config type="2" localserver="oldxyz.com" liveserver="oldxyz.com" httpuri="/etmailregistration/unsubfrmapp.aspx?sendmail=1" params="txt_id,txt_sid" readtimeout="39000" retry="3"/> </xsl:for-each> </xsl:otherwise> </xsl:choose>
my service call newxyz.com
if txt_sid = 110
calls newxyz.com
if txt_sid = 120
calls newxyz.com
, not oldxyz.com
can please tell me wrong.
your test says “if anywhere in document, there actionparams
element not top-most element , has attribute txt_sid
value of '110'
, …”.
now, didn't provide enough input sure , didn't specify expected happen , saw instead. i'm feeling guessing today , assume didn't want check full document, below current context. try either using ./actionparams/@txt_sid='110'
or .//actionparams/@txt_sid='110'
, depending on looking for. it's idea first think looking instead of blindly trying 1 of these.
Comments
Post a Comment