AnsweredAssumed Answered

Exporting different tables to XML

Question asked by rrighini on Jun 3, 2010
Latest reply on Jun 3, 2010 by rrighini

Title

Exporting different tables to XML

Post

Got my answer here last week so am hoping for another response.  I have two tables "School" and "Pupils".  "School" has only one record with fields for school name, school addresss etc.  Pupils has many records with many fields.  If I export to my style sheet I get as many records for "School" as it produces one for each pupil.  I need my stylesheet to have school data at the top (just once) and then my list of pupils (from the Pupils table.  Can anyone help please?  My current stylesheet :

 

<School>
 <SchoolCharacteristics>
         <SchoolName><xsl:value-of select="./fm:SchoolName" /></SchoolName>
   <Phase><xsl:value-of select="./fm:SchoolPhase" /></Phase>
   <SchoolType><xsl:value-of select="./fm:SchoolType" /></SchoolType>
   <GenderSixthForm><xsl:value-of select="./fm:GenderSixthForm" /></GenderSixthForm>
   <GenderOfEntry><xsl:value-of select="./fm:GenderOfEntry" /></GenderOfEntry>
   <HighestNCyear><xsl:value-of select="./fm:HighestNCyear" /></HighestNCyear>
   <LowestNCyear><xsl:value-of select="./fm:LowestNCyear" /></LowestNCyear>
   <Intake><xsl:value-of select="./fm:Intake" /></Intake>
   <Governance><xsl:value-of select="./fm:Governance" /></Governance>
   <Email><xsl:value-of select="./fm:Email" /></Email>
   <PhoneNo><xsl:value-of select="./fm:PhoneNo" /></PhoneNo>

</SchoolCharacteristics>

</School>

<Pupils>
   <PupilsOnRoll>
  <xsl:for-each select="fm:FMPDSORESULT/fm:ROW">
    <xsl:attribute name="PupilRecordNo"><xsl:value-of select="./fm:PupilRecordNo" /></xsl:attribute>
    <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>
     <MiddleNames><xsl:value-of select="./fm:_MiddleNames" /></MiddleNames>
     <PreferredSurname><xsl:value-of select="./fm:_PreferredSurname" /></PreferredSurname> 
     <FormerSurname><xsl:value-of select="./fm:_FormerSurname" /></FormerSurname>
     <Gender><xsl:value-of select="./fm:_Gender" /></Gender> 
     <DOB><xsl:value-of select="./fm:_DOB" /></DOB>
    </PupilIdentifiers>

 </PupilIOnRoll>

 </PupilsOnRoll>

 </Pupils>













Outcomes