View Single Post
  #1 (permalink)  
Old September 14th, 2005, 01:37 PM
VijayKumar VijayKumar is offline
Registered User
 
Join Date: Sep 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default calling one template in other template

Hi,
    I plead ignorance, new to xml xslt.

I want the provider list dropdown to be used in
<xsl:template match="subclass[@name='assigneeDateOfServiceList']">

the way it is working in
<xsl:template match="subclass[@name='noFaultProviderList']">

Thanks for your efforts
xsl file and xml file are as follows

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

    Provider list

    -->
    <xsl:template match="subclass[@name='noFaultProviderList']">
        <div class="boxContain741" id="assigneeAssocUtil">

            <table width="100%" border="1" bordercolor="blue" cellspacing="0" cellpadding="0" id="form">
                <tr>
                    <td width="80">
                        <strong>This Assignee is associated with the following Provider(s):</strong>
                    </td>
                    <td>
                        <xsl:call-template name="ShowProviderList">
                            <xsl:with-param name="Providers" select="."/>
                        </xsl:call-template>
                    </td>
                </tr>
            </table>


        </div>
    </xsl:template>

    <xsl:template match="subclass[@name='assigneeDateOfServiceList']">
        <table>
            <tr>
                <td>
                    <input type="text" class="sm-medium" maxlength="10">
                        <xsl:attribute name="onChange">oPage.setChangeFlag()</xsl:attribute>
                        <xsl:attribute name="onblur">if(validateField(this,'shortDate')){ oPage.cacheChangeInXml('/class/subclass[@name=\'assigneeDateOfServiceList\']/subclass[@name=\'<xsl:value-of select="$ID"/>\']/property[@name=\'startDate\']',this, '/class/property[@name=\'dateOfServiceIsChanged\']')}</xsl:attribute>
                        <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>
                    <input type="text" class="sm-medium" maxlength="10">
                        <xsl:attribute name="onChange">oPage.setChangeFlag()</xsl:attribute>
                        <xsl:attribute name="onblur">if(validateField(this,'shortDate')){ oPage.cacheChangeInXml('/class/subclass[@name=\'assigneeDateOfServiceList\']/subclass[@name=\'<xsl:value-of select="$ID"/>\']/property[@name=\'endDate\']',this, '/class/property[@name=\'dateOfServiceIsChanged\']')}</xsl:attribute>
                        <xsl:attribute name="name"><xsl:value-of select="concat('assigneeDateOfServiceList.', $ID, '.endDate')"/></xsl:attribute>
                        <xsl:attribute name="value"><xsl:value-of select="property[@name='endDate']"/></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:attribute name="onChange">oPage.setChangeFlag()</xsl:attribute>
            <xsl:attribute name="onBlur">oPage.multiSelectCacheChangeInXml('/class/subclass[@name=\'noFaultProviderList\']', this, 'property[@name=\'associated\']')</xsl:attribute>
            <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>


==== this is xml file ===================
- <class name="AssigneeOfNoFault">
  <property name="className" required="false">AssigneeOfNoFault</property>
- <subclass name="requiredList">
  <property name="0" required="false">lastName</property>
  </subclass>
  <property name="id" required="false">1</property>
  <property name="noFaultID" required="false">1</property>
  <property name="summonsNumber" required="false">555XXX</property>
  <property name="psNumber" required="false">111PPP</property>
  <property name="firstName" required="false">Dan</property>
  <property name="lastName" required="true">Quale</property>
  <property name="noticeOfTrial" required="false">test notice of trial</property>
  <property name="motionToStrike" required="false">yo motion</property>
  <property name="juryDemandID" required="false">2</property>
  <property name="noteOfIssueServed" required="false">go</property>
  <property name="verdict" required="false">verdict dunno</property>
  <property name="amountInDispute" required="false">amt in dispute</property>
  <property name="reasonDeniedID" required="false">3</property>
  <property name="reasonDeniedOther" required="false">whatever 3 is</property>
  <property name="dateOfLoss" required="false">loss date</property>
  <property name="amountPaidOut" required="false">how much paid?</property>
  <property name="timely" required="false">1</property>
- <subclass name="address">
  <property name="id" required="false">4321</property>
  <property name="suite" required="false" />
  <property name="street" required="false" />
  <property name="city" required="false" />
  <property name="state" required="false" />
  <property name="zip" required="false" />
  <property name="homePhone" required="false" />
  <property name="officePhone" required="false">(718) 803-4325</property>
  <property name="cellPhone" required="false" />
  <property name="beeper" required="false" />
  <property name="fax" required="false" />
  <property name="email" required="false" />
  </subclass>
- <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 name="1">
  <property name="id" required="false">1</property>
  <property name="date" required="false">2/1/2003</property>
  <property name="amount" required="false">200</property>
  </subclass>
  </subclass>
  <property name="assigneeDateOfServiceTotal" required="false">200</property>
- <subclass name="assigneeInsuredInfoList">
- <subclass name="1">
  <property name="id" required="false">1</property>
  <property name="firstName" required="false">Tony</property>
  <property name="lastName" required="false">Batofuko</property>
  <property name="street" required="false">333 brook ave</property>
  <property name="city" required="false">Brooklyn</property>
  <property name="state" required="false">NY</property>
  <property name="zip" required="false">10003</property>
  </subclass>
- <subclass name="2">
  <property name="id" required="false">2</property>
  <property name="firstName" required="false">Jimmy</property>
  <property name="lastName" required="false">Stack</property>
  <property name="street" required="false">333 1st street</property>
  <property name="city" required="false">New York</property>
  <property name="state" required="false">NY</property>
  <property name="zip" required="false">12211</property>
  </subclass>
  </subclass>
- <subclass name="providerList">
  <property name="0" required="false">1</property>
  <property name="1" required="false">2</property>
  </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 name="2">
  <property name="id" required="false">2</property>
  <property name="firstName" required="false">Sam</property>
  <property name="lastName" required="false">Mathews</property>
  <property name="associated">1</property>
  </subclass>
- <subclass name="2">
  <property name="id" required="false">2</property>
  <property name="firstName" required="false">Generic</property>
  <property name="lastName" required="false">Person</property>
  <property name="associated">1</property>
  </subclass>
  </subclass>
- <subclass name="LookupHandler">
- <subclass name="assignee">
  <property name="2" required="false">Hilfiger, Tommy</property>
  <property name="1" required="false">Quale, Dan</property>
  </subclass>
- <subclass name="reasonsDenied">
  <property name="1" required="false">Too Fast</property>
  <property name="2" required="false">Not Enough Money</property>
  <property name="3" required="false">Doesn't Know How To Write</property>
  <property name="4" required="false">Too Expensive</property>
  <property name="5" required="false">Wintertime Rules</property>
  </subclass>
  </subclass>
  </class>