AnsweredAssumed Answered

xsl: variable name

Question asked by rrighini on Jan 21, 2017
Latest reply on Jan 22, 2017 by beverly

HI all,

 

I'm trying to export some data using the following xsl set up but every time I try to export the data filemaker tells me that variable name or parameter has already been assigned so I can't use it to export the grandchild data in "additional payments".  I know one of you will know the solution to my problem and I'll be eternally grateful.

 

Here's my stylesheet

<ContractOrServiceGroup>

    <ContractOrService>

     <xsl:for-each select="fm:PayrollNo/fm:DATA">

          <xsl:variable name="pos" select="position()"/>

      <ContractType><xsl:value-of select="../../fm:ContractType/fm:DATA[$pos]" /></ContractType>

      <ContractStart><xsl:value-of select="../../fm:ContractStart/fm:DATA[$pos]" /></ContractStart>   

      <ContractEnd><xsl:value-of select="../../fm:ContractEnd/fm:DATA[$pos]" /></ContractEnd>

      <Post><xsl:value-of select="../../fm:ContractPost/fm:DATA[$pos]" /></Post>

      <SchoolArrivalDate><xsl:value-of select="../../fm:SchoolArrivalDate/fm:DATA[$pos]" /></SchoolArrivalDate>

      <DailyRate><xsl:value-of select="../../fm:DailyRate/fm:DATA[$pos]" /></DailyRate>

      <DestinationCode><xsl:value-of select="../../fm:DestinationCode/fm:DATA[$pos]" /></DestinationCode>

      <Origin><xsl:value-of select="../../fm:Origin/fm:DATA[$pos]" /></Origin>

      <PayReviewDate><xsl:value-of select="../../fm:PayReviewDate/fm:DATA[$pos]" /></PayReviewDate>

      <LASchoolLevel><xsl:value-of select="../../fm:LASchoolLevel/fm:DATA[$pos]" /></LASchoolLevel>    

     <PostLevelDetails>

      <Payments>

       <PayRange><xsl:value-of select="../../fm:PayRange/fm:DATA[$pos]" /></PayRange>

       <PayFramework><xsl:value-of select="../../fm:LeadershipPayFramework/fm:DATA[$pos]" /></PayFramework>

       <PayRangeMinimum><xsl:value-of select="../../fm:LeadershipPayRangeMinimum/fm:DATA[$pos]" /></PayRangeMinimum>

       <PayRangeMaximum><xsl:value-of select="../../fm:LeadershipPayRangeMaximum/fm:DATA[$pos]" /></PayRangeMaximum>

       <BasePay><xsl:value-of select="../../fm:BasePay/fm:DATA[$pos]" /></BasePay>

       <SafeguardedSalary><xsl:value-of select="../../fm:SafeguardedSalary/fm:DATA[$pos]" /></SafeguardedSalary>

      </Payments>

      <AdditionalPayments>

       <AdditionalPayment>

        <xsl:for-each select="fm:AdditionalPaymentType/fm:DATA">

        <xsl:variable name="pos" select="position()"/>

        <PaymentType><xsl:value-of select="../../fm:AdditionalPaymentType/fm:DATA[$pos]" /></PaymentType>

        <PaymentAmount><xsl:value-of select="../../fm:AdditionalPaymentAmount/fm:DATA[$pos]" /></PaymentAmount>

        <PayStartDate><xsl:value-of select="../../fm:AdditionalPaymentStartDate/fm:DATA[$pos]" /></PayStartDate>

        <PayEndDate><xsl:value-of select="../../fm:AdditionalPaymentEndDate/fm:DATA[$pos]" /></PayEndDate>

       </xsl:for-each>

       </AdditionalPayment>

      </AdditionalPayments>

     

     </PostLevelDetails>

     </xsl:for-each>

    </ContractOrService>

   </ContractOrServiceGroup>

  

 

 

 

With thanks

Outcomes