XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Hari KrishnaSubject: If Else Condition along with Loop
Author: Hari Krishna
Date: 05 Dec 2007 12:56 PM
Any Help is much appreciated.

E1EDL37 contains one of the field value as RFID_PALLET and RFID_CASE
When Pallet comes, i need to find the relative cases and write below to the pallet. This is working fine with the below logic. Case variable will contains those RFID_CASE numbers and search and write them below the pallet. If i have any number of pallets and correspondent cases, it is taking care of.

<xsl:for-each select="E1EDL37[VHILM='RFID_PALL']">
<xsl:copy-of select="." />
<xsl:for-each select="E1EDL44">
<xsl:variable name="Case">
<xsl:value-of select="EXIDV" />
</xsl:variable>
<xsl:copy-of select="../../E1EDL37[EXIDV=$Case]" />
</xsl:for-each>
</xsl:for-each>


But when it comes to only cases with out Pallet's, i am trying to implement the code here and having some troubles. I am new to XSLT, so any logical and syntax is much appreciated

What i am trying to here is
First Loop the E1EDl37 and see if there is any RFID_PALL exists, if yes set the variable value to YES. So that when i use xsl:when i should check for YES other wise write all the cases

I am having some syntax errors and i am not sure if the logic works fine. So can any of GURU can help me. I really appreciate any input here

<xsl:for-each select="E1EDL37[VHILM='RFID_PALL']">
<xsl:variable name="RFIDPALLET" select='YES'/>
</xsl:for-each>

<xsl:choose>
<xsl:when test='$RFIDPALLET="YES"'>
<xsl:for-each select="E1EDL37[VHILM='RFID_PALL']">
<xsl:copy-of select="." />
<xsl:for-each select="E1EDL44">
<xsl:variable name="Case">
<xsl:value-of select="EXIDV" />
</xsl:variable>
<xsl:copy-of select="../../E1EDL37[EXIDV=$Case]" />
</xsl:for-each>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="../../E1EDL37" />
</xsl:otherwise>
</xsl:choose>

Posttop
Alberto MassariSubject: If Else Condition along with Loop
Author: Alberto Massari
Date: 06 Dec 2007 09:24 AM
Hi,
XSLT is not a procedural language, so declaring a variable in this way will not work; you should just use a <xsl:when test="count(E1EDL37[VHILM='RFID_PALL']) &gt; 0"> condition.

Hope this helps,
Alberto

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.