View Single Post
  #1 (permalink)  
Old May 30th, 2005, 12:53 AM
vasmallela vasmallela is offline
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default mapping repeating xml structure to flat csv f

Hi,

  I need to map a repeating xml structure to flat csv file.

  Here are the xsd's.

Input schema:
-------------

<Root>
  <Denom1>
    <Record>
      <ID1>
      <Denom1>
      <Denom2>
    </Record>
    <Record></Record>
     ..
     ..
  <Denom2>
    <Record>
      <ID2>
      <Denom3>
      <Denom4>
    </Record>
    <Record></Record>
     ..
     ..
  </Denom2>
<Root>

Output Flat file schema:
-------------------------

<Root>
<Header>
  <ID1>
  <Denom1>
  <Denom2>
  <ID2>
  <Denom3>
  <Denom4>
</Header>
<Body>
  <ID1>
  <Denom1>
  <Denom2>
  <ID2>
  <Denom3>
  <Denom4>
</Body>
</Root>


I wrote inline XSLT in script functoid..

<xsl:template name="OrderXSLTSplit">
 <xsl:param name="param1"/>
 <xsl:param name="param2"/>
 <xsl:param name="param3"/>
 <xsl:param name="param4"/>
 <xsl:param name="param5"/>
 <xsl:param name="param6"/>
 <Body>
  <ID1><xsl:value-of select="$param1"><ID1>
  <ID2><xsl:value-of select="$param2"><ID2>
  <Denom1><xsl:value-of select="$param3"><Denom1>
  <Denom2><xsl:value-of select="$param4"><Denom2>
  <Denom3><xsl:value-of select="$param5"><Denom1>
  <Denom4><xsl:value-of select="$param6"><Denom1>
 </Body>
</xsl:template>

This is the output that is generated by the map...

ID1,Denom1,Denom2,ID2,Denom3,Denom4
VS100,100,200,VS200,500s,100
VS101,200,400,VS200,500s,100
VS102,300,600,VS200,500s,100

if you observe, first record of Denom2 record is getting repeated.

Please help me in solving this issue..

Thanks
vaas
Reply With Quote