[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[xsl] xsl: variable comparision
Subject: [xsl] xsl: variable comparision From: ram <ram_kurra@xxxxxxxxxxx> Date: Thu, 18 Nov 2010 03:15:51 +0530 (IST) |
Hi, I have a mapping file and an xsl which will read this xsl and do the comparision. But the comparision is not working. I am using xslt 1.0 Here is my map file <Config-Policy> <Policy Service="EBRequest"> <QueueManager QMNumber="01" QMName="BRKQM"/> <QueueManager QMNumber="02" QMName="BEXQM"/> <RequestQueue>TEST.Req</RequestQueue> </Policy> <Policy Service="EBResponse"> <QueueManager QMNumber="01" QMName="BRKQM"/> <QueueManager QMNumber="02" QMName="BEXQM"/> <RequestQueue>TEST.RSP</RequestQueue> </Policy> </Config-Policy> here is my xsl <xsl:stylesheet version="1.0" extension-element-prefixes="dp func dpfunc dpconfig dyn" exclude-result-prefixes="dp func dpfunc dpconfig dyn" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dp="http://www.datapower.com/extensions" xmlns:func="http://exslt.org/functions" xmlns:dpfunc="http://www.datapower.com/extensions/functions" xmlns:dpconfig="http://www.datapower.com/param/config" xmlns:dyn="http://exslt.org/dynamic"> <xsl:template match="/"> <xsl:variable name="qmNumberFromContext" select="'02'"> </xsl:variable> <xsl:variable name="serviceType1"> <xsl:variable name="trType" select="normalize-space('ENBRequest')" /> <xsl:choose> <xsl:when test="($trType='EBRequest')"> <xsl:message dp:type="custom category"> Yes </xsl:message> <xsl:value-of select="'ENBRequest'" /> </xsl:when> <xsl:when test="($trType='EBResponse')"> <xsl:message dp:type="custom category"> Yes </xsl:message> <xsl:value-of select="'ENBResponse'" /> </xsl:when> <xsl:otherwise> <xsl:message dp:type="custom category"> No matching service </xsl:message> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="config" select="document('QM_Mapping_Response.xml')" /> <xsl:variable name="serviceType" select="$config/Config-Policy/Policy[@Service=$serviceType1]" /> <xsl:variable name="qmNumber" select="$serviceType/QueueManager/@QMNumber" /> <xsl:message> QMNumber = <xsl:value-of select="$qmNumber"></xsl:value-of> </xsl:message> <xsl:message> QMNumberFromContext = <xsl:value-of select="$qmNumberFromContext"></xsl:value-of> </xsl:message> <xsl:choose> <xsl:when test="$qmNumberFromContext = $qmNumber"> <xsl:variable name="mqQM" select="$serviceType/QueueManager[@QMNumber=$qmNumberFromContext]/@QMName"> </xsl:variable> <xsl:variable name="reqQueue" select="$serviceType/RequestQueue"> </xsl:variable> <xsl:variable name="mq-routing-url" select="concat('dpmq://',$mqQM,'?RequestQueue=',$reqQueue)" /> <xsl:message> DPMQURL <xsl:value-of select="$mq-routing-url"></xsl:value-of> </xsl:message> </xsl:when> <xsl:otherwise> <xsl:message>wrong</xsl:message> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet> <xsl:when test="$qmNumberFromContext = $qmNumber"> is not working.even if qmNumber is 01 its comming into when block. whats wrong here.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Was it a bug?, Michael Kay | Thread | Re: [xsl] xsl: variable comparision, Brandon Ibach |
Re: [xsl] Stumped: XSL 1.0 recursiv, Brandon Ibach | Date | Re: [xsl] xsl: variable comparision, Brandon Ibach |
Month |