Subject: Re: [xsl] xsl: variable comparision From: ram <ram_kurra@xxxxxxxxxxx> Date: Thu, 18 Nov 2010 23:26:40 +0530 (IST) |
so how to fix this one --- On Thu, 18/11/10, Brandon Ibach <brandon.ibach@xxxxxxxxxxxxxxxxxxx> wrote: > From: Brandon Ibach <brandon.ibach@xxxxxxxxxxxxxxxxxxx> > Subject: Re: [xsl] xsl: variable comparision > To: "xsl-list" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> > Date: Thursday, 18 November, 2010, 4:20 AM > Keep in mind that you're setting > $qmNumber to a node set. The > xsl:value-of instruction that you're using to print out the > value of > $qmNumber will take the string value of only the first node > in that > set. The comparison that you say isn't working will > evaluate to true > if any member of that set matches $qmNumberFromContext. > > -Brandon :) > > > On Wed, Nov 17, 2010 at 4:45 PM, ram <ram_kurra@xxxxxxxxxxx> > wrote: > > 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. > > > > > > > > > > > > > --~------------------------------------------------------------------ > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ > > or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx> > > --~-- > > > > > > --~------------------------------------------------------------------ > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ > or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx> > --~--
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] xsl: variable comparision, Brandon Ibach | Thread | Re: [xsl] xsl: variable comparision, Brandon Ibach |
[xsl] Selecting the node which have, Rashi Bhardwaj | Date | Re: [xsl] Iteration of for() for fi, Hermann Stamm-Wilbra |
Month |