<?xml version="1.0"?>
<!-- file: formatter.xls docs at the end -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<style type="text/css">
body { margin-left: 10%;}
table tbody tr td { background-color: #eee; }
table tr.odd td { background-color: #fff; }
</style>
</head>
<body>
<h3> SESSION ATTRIBUTES </h3>
<table border="1">
<tr>
<th> SESSION NAME </th>
<th> ATTRIBUTE NAME</th>
<th> ATTRIBUTE VALUE </th>
</tr>
<xsl:for-each select="/POWERMART/REPOSITORY/FOLDER/WORKFLOW/SESSION/ATTRIBUTE">
<xsl:sort select="@NAME"/>
<xsl:variable name="css-class">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$css-class}">
<td>
<xsl:value-of select="../@NAME"/>
</td>
<td>
<xsl:value-of select="@NAME"/>
</td>
<td>
<xsl:value-of select="@VALUE"/>
</td>
</tr>
</xsl:for-each>
</table>
<!-- SESSION ATTRIBUTES -->
<h3> SESSIONS </h3>
<table border="1">
<tr bgcolor="#F8F8F8">
<th>SESSION NAME</th>
<th>MAPPING NAME </th>
<th>SESSION DESCRIPTION</th>
</tr>
<xsl:for-each select="/POWERMART/REPOSITORY/FOLDER/WORKFLOW/SESSION">
<xsl:sort select="@NAME"/>
<xsl:variable name="css-class">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$css-class}">
<td>
<xsl:value-of select="@NAME"/>
</td>
<td>
<xsl:value-of select="@MAPPINGNAME"/>
</td>
<td>
<xsl:value-of select="@DESCRIPION"/>
</td>
</tr>
</xsl:for-each>
</table>
<!-- EOF SESSIONS -->
<h3> TASKS </h3>
<table border="1">
<tr bgcolor="#F8F8F8">
<th>NAME</th>
<th>DESCRIPTION</th>
</tr>
<xsl:for-each select="/POWERMART/REPOSITORY/FOLDER/WORKFLOW/TASK">
<xsl:sort select="@NAME"/>
<xsl:variable name="css-class">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$css-class}">
<td>
<xsl:value-of select="@NAME"/>
</td>
<td>
<xsl:value-of select="@DESCRIPTION"/>
</td>
</tr>
</xsl:for-each>
</table>
<!-- EOF TASKS -->
<h3> MAPPINGS </h3>
<table border="1">
<tr bgcolor="#F8F8F8">
<th>NAME</th>
<th>DESCRIPTION</th>
</tr>
<xsl:for-each select="/POWERMART/REPOSITORY/FOLDER/MAPPING">
<xsl:sort select="@NAME"/>
<xsl:variable name="css-class">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$css-class}">
<td>
<xsl:value-of select="@NAME"/>
</td>
<td>
<xsl:value-of select="@DESCRIPTION"/>
</td>
</tr>
</xsl:for-each>
</table>
<!-- EOF MAPPING -->
<h3> SOURCES </h3>
<table border="1">
<tr bgcolor="#F8F8F8">
<th>NAME</th>
<th>DESCRIPTION</th>
</tr>
<xsl:for-each select="/POWERMART/REPOSITORY/FOLDER/SOURCE">
<xsl:sort select="@NAME"/>
<xsl:variable name="css-class">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$css-class}">
<td>
<xsl:value-of select="@NAME"/>
</td>
<td>
<xsl:value-of select="@DESCRIPION"/>
</td>
</tr>
</xsl:for-each>
</table>
<!-- EOF SOURCES -->
<h3> TARGETS </h3>
<table border="1">
<tr bgcolor="#F8F8F8">
<th>NAME</th>
<th>DESCRIPTION</th>
</tr>
<xsl:for-each select="/POWERMART/REPOSITORY/FOLDER/TARGET">
<xsl:sort select="@NAME"/>
<xsl:variable name="css-class">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$css-class}">
<td>
<xsl:value-of select="@NAME"/>
</td>
<td>
<xsl:value-of select="@DESCRIPION"/>
</td>
</tr>
</xsl:for-each>
</table>
<!-- EOF TARGETS -->
<h3> CONNECTIONREFERENCES </h3>
<table border="1">
<tr bgcolor="#F8F8F8">
<th>NAME</th>
<th>DESCRIPTION</th>
<th>SESSION INSTANCE NAME </th>
</tr>
<xsl:for-each select="/POWERMART/REPOSITORY/FOLDER/WORKFLOW/SESSION/SESSIONEXTENSION/CONNECTIONREFERENCE">
<xsl:sort select="@CONNECTIONNAME"/>
<xsl:variable name="css-class">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$css-class}">
<td>
<xsl:value-of select="@CONNECTIONNAME"/>
</td>
<td>
<xsl:value-of select="@CONNECTIONTYPE"/>
</td>
<td>
<xsl:value-of select="../@SINSTANCENAME"/>
</td>
</tr>
</xsl:for-each>
</table>
<!-- EOF CONNECTIONREFERENCES -->
<h3> USER DEFINED WORKFLOW VARIABLES </h3>
<table border="1">
<tr bgcolor="#F8F8F8">
<th>WORFLOW VARIABLE NAME</th>
<th>DATA TYPE </th>
<th>SESSION INSTANCE NAME </th>
</tr>
<xsl:for-each select="/POWERMART/REPOSITORY/FOLDER/WORKFLOW/WORKFLOWVARIABLE[@USERDEFINED='YES']">
<xsl:sort select="@NAME"/>
<xsl:variable name="css-class">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$css-class}">
<td>
<xsl:value-of select="@NAME"/>
</td>
<td>
<xsl:value-of select="@DATATYPE"/>
</td>
<td>
<xsl:value-of select="../@SINSTANCENAME"/>
</td>
</tr>
</xsl:for-each>
</table>
<!-- EOF CONNECTIONREFERENCES -->
<!-- START SOURCE FIELDS -->
<h3> Source fields </h3>
<table border="1">
<tr bgcolor="#F8F8F8">
<th>source NAME </th>
<th>WORFLOW VARIABLE NAME</th>
<th>DATA TYPE </th>
<th>IS NULLABLE </th>
</tr>
<xsl:for-each select="/POWERMART/REPOSITORY/FOLDER/SOURCE/SOURCEFIELD">
<xsl:sort select="../@NAME"/>
<xsl:variable name="css-class">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$css-class}">
<td>
<xsl:value-of select="../@NAME"/>
</td>
<td>
<xsl:value-of select="@NAME"/>
</td>
<td>
<xsl:value-of select="@DATATYPE"/>
</td>
<td>
<xsl:value-of select="@PRECISION"/>
</td>
<td>
<xsl:value-of select="@NULLABLE"/>
</td>
</tr>
</xsl:for-each>
</table>
<!-- STOP TARGET FIELDS -->
<!-- START TARGET FIELDS -->
<h3> Target fields </h3>
<table border="1">
<tr bgcolor="#F8F8F8">
<th>TARGET NAME </th>
<th>FIELD_NAME</th>
<th>DATA TYPE </th>
<th>PRECISION</th>
<th>IS NULLABLE</th>
</tr>
<xsl:for-each select="/POWERMART/REPOSITORY/FOLDER/TARGET/TARGETFIELD">
<xsl:sort select="../@NAME"/>
<xsl:variable name="css-class">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$css-class}">
<td>
<xsl:value-of select="../@NAME"/>
</td>
<td>
<xsl:value-of select="@NAME"/>
</td>
<td>
<xsl:value-of select="@DATATYPE"/>
</td>
<td>
<xsl:value-of select="@PRECISION"/>
</td>
<td>
<xsl:value-of select="@NULLABLE"/>
</td>
</tr>
</xsl:for-each>
</table>
<!-- STOP TARGET FIELDS -->
<div>
<h2> Documentation </h2>
<div> Purpose: </div>
<div>to provide a human readable output for an copied exported worfklow file from Informatica repository </div>
<div></div>
<div>Usage: </div>
<div>Please in the same folder where the workflow export xml file is </div>
<div>Add the following line on the second line of the exported wf xml file : </div>
<div><?xml-stylesheet type="text/xsl" href="formatter.xsl"?><!DOCTYPE POWERMART SYSTEM "powrmart.dtd"></div>
<div></div>
<div>VersionHistory : </div>
<div>1.2.0 --- 2012-10-15 16:51:53 --- ysg --- Added alternating rows with css </div>
<div>1.1.1 --- 2012-10-15 16:22:48 --- ysg --- Added source target fields </div>
<div>1.1.0 --- 2012-10-15 14:46:09 --- ysg --- Added session - mapping combination , session attributes </div>
<div>1.0.0 --- 2012-10-12 14:50:43 --- ysg --- Initial Creation </div>
<div></div>
<div></div>
<div></div>
<div>eof:file formatter.xsl </div>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>