xsl-list
[Top] [All Lists]

String comparisons

2002-09-22 21:50:17
Hello,
 I have a problem with string comparisons.
 The following templates are called from within another
template(Message-MessageInfo). I have to find a matching message in the
"behaviour" section and compare the 'cleared' string in this section. If it
is not cleared, it is the clearing alarm(s) else it is a triggering
alarm(s).
 The second template call works fine, but the ...TriggerTraps template call
doesn't. What could be the hitch? help needed asap.
 
<xsl:template name="Call_MsgClearedBySystemFindTriggerTraps">
    <xsl:variable name="MsgName" select="Name"/> --
(Message-MessageInfo-Name)
    <xsl:for-each select="//Behaviour/BehaviourInfo">
      <xsl:variable name="BhvrMsgName"
select="BehaviourMessages/BehaviourMessagesInfo/Name"/>
      <xsl:if test="$BhvrMsgName=$MsgName">
        <xsl:variable name="x"
select="BehaviourMessages/BehaviourMessagesInfo/OIDInfo/Message/MessageInfo/
MsgLevel[TextString!='Cleared']"/>
        <xsl:if test="$x">
          <xsl:text>This alarm message is triggered by the trap </xsl:text>
          <xsl:if test="$x[2]">s</xsl:if>
          <xsl:for-each select="Trap/Name">
           <B><xsl:value-of select="."/></B>
           <xsl:if test="position()&lt;last()"><xsl:text>,
</xsl:text></xsl:if>
          </xsl:for-each>
        </xsl:if>
      </xsl:if>
    </xsl:for-each>
  </xsl:template>

  <xsl:template name="Call_MsgClearedBySystemFindClearTraps">
    <xsl:variable name="MsgName" select="Name"/>
    <xsl:for-each select="//Behaviour/BehaviourInfo">
      <xsl:variable name="BhvrMsgName"
select="BehaviourMessages/BehaviourMessagesInfo/Name"/>
      <xsl:if test="$BhvrMsgName=$MsgName">        
        <xsl:variable name="y"
select="BehaviourMessages/BehaviourMessagesInfo/OIDInfo/Message/MessageInfo/
MsgLevel[TextString='Cleared']"/>
        <xsl:if test="$y">
          <xsl:text> and will be cleared when the trap </xsl:text>
          <xsl:if test="$y[2]">s</xsl:if>
          <xsl:for-each select="Trap/Name">
           <B><xsl:value-of select="."/></B>
           <xsl:if test="position()&lt;last()"><xsl:text>,
</xsl:text></xsl:if>
          </xsl:for-each><xsl:text> comes in.</xsl:text>
        </xsl:if>
      </xsl:if>
    </xsl:for-each>
  </xsl:template>

rgds,
L. Gnanendra Satish
- - - - - - - Appended by Scientific-Atlanta, Inc. - - - - - - - 
This e-mail and any attachments may contain information which is
confidential, proprietary, privileged or otherwise protected by law. The
information is solely intended for the named addressee (or a person
responsible for delivering it to the addressee). If you are not the intended
recipient of this message, you are not authorized to read, print, retain,
copy or disseminate this message or any part of it. If you have received
this e-mail in error, please notify the sender immediately by return e-mail
and delete it from your computer.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>