Originally posted by: SystemAdmin
You can do it in a map but it is much easier if you create an XSL file and use it to extract the desired data from the MTS file. It takes about 30-40 lines of XSL code. And this code can be used on any type tree and may be easily modified should you wish to extract different fields. See
http://www.w3schools.com/xsl/default.asp. Here's a simple XSL file to pull card info & map rules from a map export file:
code:1:3f88bffb71<?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Copyright EC Solutions, Inc., an EAI, EDI, & SAP consultancy -->
<!-- with extensive Mercator/DataStage TX experience. 330-606-6826 -->
<xsl:template match="/">
<html>
<body>
DataStage TX Map Export
<table border="1">
<xsl:for-each select="MMS/Map">
<tr>
<th align="left">
Map:</th>
<th align ="center">
<xsl:value-of select="@name"/></th>
</tr>
<tr bgcolor="#FFAAAA">
<th align="left">No.</th>
<th align="center">Card Name</th>
<th align="left">Type Tree</th>
<th align="center">Type</th>
</tr>
<xsl:for-each select="Input/Schema">
<tr bgcolor="#99CCCC">
<td><xsl:value-of select="@cardnumber"/></td>
<td><xsl:value-of select="@cardname"/></td>
<td><xsl:value-of select="@typetree"/></td>
<td><xsl:value-of select="@type"/></td>
</tr>
</xsl:for-each>
<xsl:for-each select="Output">
<xsl:for-each select="Schema">
<tr bgcolor="#99FFFF">
<td><xsl:value-of select="@cardnumber"/></td>
<td><xsl:value-of select="@cardname"/></td>
<td><xsl:value-of select="@typetree"/></td>
<td><xsl:value-of select="@type"/></td>
</tr>
</xsl:for-each>
<xsl:for-each select="MapRule">
<tr>
<td></td>
<td><xsl:value-of select="objectset"/></td>
<td><xsl:value-of select="objectrule"/></td>
</tr>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template></xsl:stylesheet>[/code:1:3f88bffb71]
#IBMSterlingTransformationExtender#DataExchange#IBM-Websphere-Transformation-Extender