pelegk Posted June 29, 2003 Posted June 29, 2003 i have this code and i am intrested that if there is no <item> then the response to the client will be an empty string and not like know that the <table....> is being sent to the user(even there is no data!!!) thnaks in adbvance Peleg <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <table dir="rtl" align="center" width="100%"> <tr> <td class="text14"><b>שם משפחה</b></td> <td class="text14"><b>שם פרטי</b></td> <td class="text14"><b>שם עיר</b></td> <td class="text14"><b>טלפון</b></td> <td class="text14"><b>מידע נוסף</b></td> </tr> <xsl:for-each select="//ROOT/DRSpecDataArray/item"> <tr> <td class="text14"> <xsl:attribute name="id"> <xsl:value-of select="concat('LName',position())"/> </xsl:attribute> <xsl:attribute name="value"> <xsl:value-of select="normalize-space(LName)"/> </xsl:attribute> <xsl:value-of select="normalize-space(LName)"/> </td> <td class="text14"> <xsl:attribute name="id"> <xsl:value-of select="concat('FName',position())"/> </xsl:attribute> <xsl:attribute name="value"> <xsl:value-of select="normalize-space(FName)"/> </xsl:attribute> <xsl:value-of select="normalize-space(FName)"/> </td> <td class="text14" style="visibility:hidden;position:absolute;posx:1;posy:1"> <xsl:attribute name="id"> <xsl:value-of select="concat('plcName',position())"/> </xsl:attribute> <xsl:value-of select="normalize-space(plcName)"/> </td> <td class="text14"> <xsl:attribute name="id"> <xsl:value-of select="concat('cityName',position())"/> </xsl:attribute> <xsl:value-of select="normalize-space(cityName)"/> </td> <td class="text14" dir="ltr" align="right"> <xsl:attribute name="id"> <xsl:value-of select="concat('phone1',position())"/> </xsl:attribute> <xsl:value-of select="normalize-space(phone1)"/> </td> <td class="text14" style="cursor:hand" onclick="SergentDetailes({position()})"><u> מידע נוסף </u> </td> <td style="visibility:hidden;position:absolute;posx:1;posy:1"> <xsl:attribute name="id"> <xsl:value-of select="concat('houseNo',position())"/> </xsl:attribute> <xsl:value-of select="normalize-space(houseNo)"/> </td> <td style="visibility:hidden;position:absolute;posx:1;posy:1"> <xsl:attribute name="id"> <xsl:value-of select="concat('parking',position())"/> </xsl:attribute> <xsl:value-of select="normalize-space(parking)"/> </td> <td style="visibility:hidden;position:absolute;posx:1;posy:1"> <xsl:attribute name="id"> <xsl:value-of select="concat('disabledAccess',position())"/> </xsl:attribute> <xsl:value-of select="normalize-space(disabledAccess)"/> </td> <td style="visibility:hidden;position:absolute;posx:1;posy:1"> <xsl:attribute name="id"> <xsl:value-of select="concat('fax',position())"/> </xsl:attribute> <xsl:value-of select="normalize-space(fax)"/> </td> <td style="visibility:hidden;position:absolute;posx:1;posy:1"> <xsl:attribute name="id"> <xsl:value-of select="concat('regionName',position())"/> </xsl:attribute> <xsl:value-of select="normalize-space(regionName)"/> </td> <td style="visibility:hidden;position:absolute;posx:1;posy:1"> <xsl:attribute name="id"> <xsl:value-of select="concat('plcType',position())"/> </xsl:attribute> <xsl:value-of select="normalize-space(plcType)"/> </td> <td style="visibility:hidden;position:absolute;posx:1;posy:1"> <xsl:attribute name="id"> <xsl:value-of select="concat('licID',position())"/> </xsl:attribute> <xsl:value-of select="normalize-space(licID)"/> </td> <td style="visibility:hidden;position:absolute;posx:1;posy:1"> <xsl:attribute name="id"> <xsl:value-of select="concat('specialization',position())"/> </xsl:attribute> <xsl:value-of select="normalize-space(specialization)"/> </td> <td style="visibility:hidden;position:absolute;posx:1;posy:1"> <xsl:attribute name="id"> <xsl:value-of select="concat('streetName',position())"/> </xsl:attribute> <xsl:value-of select="normalize-space(streetName)"/> </td> <td style="visibility:hidden;position:absolute;posx:1;posy:1"> <xsl:attribute name="id"> <xsl:value-of select="concat('plcNo',position())"/> </xsl:attribute> <xsl:value-of select="normalize-space(plcNo)"/> </td> <td style="visibility:hidden;position:absolute;posx:1;posy:1"> <xsl:attribute name="id"> <xsl:value-of select="concat('zip',position())"/> </xsl:attribute> <xsl:value-of select="normalize-space(zip)"/> </td> <td style="visibility:hidden;position:absolute;posx:1;posy:1"> <xsl:attribute name="id"> <xsl:value-of select="concat('phone2',position())"/> </xsl:attribute> <xsl:value-of select="normalize-space(phone2)"/> </td> </tr> </xsl:for-each> <tr > <td id="tdNextPage" style="visibility:hidden;position:absolute;posx:1;posy:1"> <xsl:value-of select="normalize-space(//ROOT/errorCode)"/> </td> </tr> </table> </xsl:template> </xsl:stylesheet>
Recommended Posts
This topic is 7819 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now