Jump to content

help needed with xsl code


pelegk

This topic is 7630 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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>&#1513;&#1501; &#1502;&#1513;&#1508;&#1495;&#1492;</b></td>

<td class="text14"><b>&#1513;&#1501; &#1508;&#1512;&#1496;&#1497;</b></td>

<td class="text14"><b>&#1513;&#1501; &#1506;&#1497;&#1512;</b></td>

<td class="text14"><b>&#1496;&#1500;&#1508;&#1493;&#1503;</b></td>

<td class="text14"><b>&#1502;&#1497;&#1491;&#1506; &#1504;&#1493;&#1505;&#1507;</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>

&#1502;&#1497;&#1491;&#1506; &#1504;&#1493;&#1505;&#1507;

</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>

Link to comment
Share on other sites

This topic is 7630 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.