[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Re: Returning a value from a template
At 2010-11-10 09:36 -0800, Narayan wrote:
Yes ... don't use the flag. Something along the lines of: Then you *don't* need the loop at all: <xsl:template name="getOrderSource"> <xsl:choose> <xsl:when test='/ns0:Transaction-850/ns0:Loop-N1/ ns0:Segment-N1/ns0:Element-66 = "21"'>NAEDI</xsl:when> <xsl:otherwise>NAEDIBrokerage</xsl:otherwise> </xsl:choose> </xsl:template> In XPath when you address a set of nodes as an operand in a test, the test is repeated for every member of the node set until either a true() value is returned by any member (you aren't told which), or until the node set is exhausted and a false() value is returned. I hope this helps. . . . . . . . . . Ken
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|