View Single Post
  #3 (permalink)  
Old September 15th, 2005, 09:32 AM
VijayKumar VijayKumar is offline
Registered User
 
Join Date: Sep 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Michael,
            Thanks for pointing in the right direction, here is the modified version. xsl file and xml file.
GOAL: TO have a drop down list in template('assigneeDateOfServiceList') by calling template(ShowProviderList).

Thanks
Vijay

<?xml version="1.0" encoding="UTF-8" ?>
<stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">

    <xsl:template match="subclass[@name='assigneeDateOfServiceList']">
    <table>
    <tr>
        <td>
            <input type="text" class="sm-medium" maxlength="10">
                <xsl:attribute name="name"><xsl:value-of select="concat('assigneeDateOfServiceList.', $ID, '.startDate')"/></xsl:attribute>
                <xsl:attribute name="value"><xsl:value-of select="property[@name='startDate']"/></xsl:attribute>
            </input>
        </td>
        <td>

                <xsl:call-template name="ShowProviderList">
                    <xsl:with-param name="Providers" select="."/>
                </xsl:call-template>

        </td>
    </tr>
    </table>
    </xsl:template>

    <xsl:template name="ShowProviderList">
        <xsl:param name="Providers"/>
        <select muliple="yes" size="1" name="providerList">
        <xsl:for-each select="$Providers/subclass">
            <xsl:variable name="ID" select="property[@name='id']"/>
            <option>
                <xsl:attribute name="value"><xsl:value-of select="property[@name='id']"/></xsl:attribute>
                <xsl:if test="property[@name='associated'] != '0'">
                    <xsl:attribute name="selected">true</xsl:attribute>
                </xsl:if>
                <xsl:value-of select="property[@name='lastName']"/>
                <xsl:if test="string-length( property[@name='firstName'] )">, <xsl:value-of select="property[@name='firstName']"/>
                </xsl:if>
            </option>
        </xsl:for-each>
        </select>
    </xsl:template>

</stylesheet>
--===================== xml file =====================
- <subclass name="assigneeDateOfServiceList">
- <subclass name="2">
  <property name="id" required="false">2</property>
  <property name="date" required="false">4/1/2002</property>
  <property name="amount" required="false">0</property>
  </subclass>
  </subclass>
- <subclass name="noFaultProviderList">
- <subclass name="1">
  <property name="id" required="false">1</property>
  <property name="firstName" required="false">Ken</property>
  <property name="lastName" required="false">Gilmer</property>
  <property name="associated">0</property>
  </subclass>
- <subclass name="2">
  <property name="id" required="false">2</property>
  <property name="firstName" required="false">Jon</property>
  <property name="lastName" required="false">Shmidt</property>
  <property name="associated">0</property>
  </subclass>
  </subclass>