AnsweredAssumed Answered

XSLT related records

Question asked by rrighini on May 30, 2010
Latest reply on May 30, 2010 by rrighini

Title

XSLT related records

Post

Can someone tell me where I'm going wrong?  I have two tables - PupilDetails and Exclusions related to each other by PupilRecordNo.  I want to export pupil details and then related exclusion records(which may be more than one).  This is my xslt

 

<?xml version='1.0' encoding='UTF-8' ?>
<xsl:stylesheet version='1.0'   
 xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
 xmlns:fm="http://www.filemaker.com/fmpdsoresult"
 exclude-result-prefixes="fm">
 <xsl:output version='1.0' encoding='UTF-8' indent='yes' method='xml' />
 <xsl:template match="/">
<Pupils>
 <PupilsOnRoll>
 <xsl:for-each select="fm:FMPDSORESULT/fm:ROW">
   <PupilOnRoll> 
    <PupilIdentifiers>
     <UPN><xsl:value-of select="./fm:_UPN" /></UPN>
     <UniqueLearnerNumber><xsl:value-of select="./fm:ULN" /></UniqueLearnerNumber>
     <FormerUPN><xsl:value-of select="./fm:_formerUPN" /></FormerUPN>
     <Surname><xsl:value-of select="./fm:_surname" /></Surname>
     <Forename><xsl:value-of select="./fm:_forename" /></Forename>
    </PupilIdentifiers>
   <Exclusions>
     <TermlyExclusion>
      <Category><xsl:value-of select="./fm:_CategoryCode" /></Category>
      <Reason><xsl:value-of select="./fm:_ReasonCode" /></Reason>
      <StartDate><xsl:value-of select="./fm:_StartDate" /></StartDate>
      <Sessions><xsl:value-of select="./fm:_NoSessions" /></Sessions>     
      <InCare><xsl:value-of select="./fm:ExInCare" /></InCare>
      <SENprovision><xsl:value-of select="./fm:ExSENprovision" /></SENprovision>
     </TermlyExclusion>
  </Exclusions>
  </PupilOnRoll>
  </xsl:for-each>
 </PupilsOnRoll>
 </Pupils>
 </xsl:template>
</xsl:stylesheet>

 

However, when the exclusion data exports I don't get separate records.  All related records appear one after the other for each item eg.- 

 

<StartDate>24/9/200916/10/200918/12/2009</StartDate>

 

what I want is

 

<StartDate>24/9/2009</StartDate>

<StartDate>26/10/2009</StartDate>

<StartDate>01/01/2010</StartDate>

 

Does anyone know how to achieve this? Thanks.

 

I'm on FM 10,

















Outcomes