Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8524

Re: Help needed on XSLT n:m mapping

$
0
0

Just resolved it. Here's the program if you are interested:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
  <DT_IN>
  <xsl:apply-templates/>
  </DT_IN>
</xsl:template>

<xsl:template match="DT_IN/DATA">
  <xsl:variable name="empid" select="PERNR"/>
  <xsl:variable name="payperiod" select="PayPeriod"/>
    <xsl:for-each select="PayRecord">
      <DATA>
      <PERNR>
        <xsl:value-of select="$empid"/>
      </PERNR>
      <WageType>
      <xsl:value-of select="WageType"/>
      </WageType>
      <Hours>
        <xsl:value-of select="Hours"/>
      </Hours>
      <Payperiod>
        <xsl:value-of select="$payperiod"/>
      </Payperiod>
      </DATA>
    </xsl:for-each>
</xsl:template>
</xsl:stylesheet>


Viewing all articles
Browse latest Browse all 8524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>