p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   Biztalk (http://p2p.wrox.com/biztalk-112/)
-   -   mapping repeating xml structure to flat csv f (http://p2p.wrox.com/biztalk/29876-mapping-repeating-xml-structure-flat-csv-f.html)

vasmallela May 30th, 2005 12:53 AM

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


All times are GMT -4. The time now is 12:22 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.