<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
	<xsl:output method="xml"/>
	<xsl:param name="tcID"/>
	<xsl:template match="/">
		<xsl:element name="data">
			<xsl:attribute name="jsxid">jsxroot</xsl:attribute>
			<xsl:for-each select="//table">
				<xsl:element name="record">
					<xsl:attribute name="jsxtext">
						<xsl:value-of select="@key"/>
					</xsl:attribute>
					<xsl:attribute name="jsxid">
						<xsl:value-of select="generate-id()"/>
					</xsl:attribute>
					<xsl:for-each select="tc">
						<xsl:element name="record">
							<xsl:attribute name="jsxid">
								<xsl:value-of select="name()"/><xsl:text>_</xsl:text>
								<xsl:value-of select="position()"/>
							</xsl:attribute>
							<xsl:for-each select="@*">
								<xsl:attribute name="{name()}">
									<xsl:value-of select="."/>
								</xsl:attribute>
							</xsl:for-each>
							<xsl:for-each select="../tr">
								<xsl:element name="record">
									<xsl:attribute name="td">
										<xsl:value-of select="td"/>
									</xsl:attribute>
									<xsl:attribute name="jsxtext">
										<xsl:value-of select="@name"/>
									</xsl:attribute>
									<xsl:attribute name="jsxid">
										<xsl:value-of select="name()"/><xsl:text>_</xsl:text>
										<xsl:value-of select="position()"/>
									</xsl:attribute>
								</xsl:element>
							</xsl:for-each>
						</xsl:element>
					</xsl:for-each>
				</xsl:element>
			</xsl:for-each>
		</xsl:element>
	</xsl:template>
	<xsl:template match="table" mode="tc"/>
	<xsl:template match="table" mode="tr">
		<xsl:for-each select="tr">
			<xsl:element name="record">
				<xsl:attribute name="jsxtext">
					<xsl:value-of select="@name"/>
				</xsl:attribute>
				<xsl:attribute name="jsxid">
					<xsl:value-of select="name()"/><xsl:text>_</xsl:text>
					<xsl:value-of select="position()"/>
				</xsl:attribute>
				<xsl:attribute name="td">
					<xsl:value-of select="child::td[position()=$tcID]"/>
				</xsl:attribute>
			</xsl:element>
		</xsl:for-each>
	</xsl:template>
	<xsl:template name="tdNodes" match="tr">
		<xsl:param name="tcID"/><!--<xsl:for-each select="dataset/table/*"> -->
		<xsl:element name="record">
			<xsl:attribute name="jsxtext">
				<xsl:value-of select="@name"/>
			</xsl:attribute>
			<xsl:attribute name="jsxid">
				<xsl:value-of select="name()"/><xsl:text>_</xsl:text>
				<xsl:value-of select="position()"/>
			</xsl:attribute>
			<xsl:attribute name="tc">
				<xsl:value-of select="td[position()=$tcID]"/>
			</xsl:attribute>
		</xsl:element><!-- </xsl:for-each> -->
	</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2006. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="rtview2cdf" userelativepaths="yes" externalpreview="no" url="lookup.xml" htmlbaseurl="" outputurl="" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no" ><SourceSchema srcSchemaPath="lookup.xml" srcSchemaRoot="dataset" AssociatedInstance="" loaderFunction="document" loaderFunctionUsesURI="no"/></MapperInfo><MapperBlockPosition><template match="/"><block path="xsl:element/xsl:for&#x2D;each" x="273" y="16"/><block path="xsl:element/xsl:for&#x2D;each/xsl:element/xsl:attribute[1]/xsl:value&#x2D;of" x="274" y="90"/><block path="xsl:element/xsl:for&#x2D;each/xsl:element/xsl:for&#x2D;each" x="273" y="110"/><block path="xsl:element/xsl:for&#x2D;each/xsl:element/xsl:for&#x2D;each/xsl:element/xsl:attribute/xsl:value&#x2D;of" x="148" y="121"/><block path="xsl:element/xsl:for&#x2D;each/xsl:element/xsl:for&#x2D;each/xsl:element/xsl:attribute/xsl:value&#x2D;of[1]" x="206" y="136"/><block path="xsl:element/xsl:for&#x2D;each/xsl:element/xsl:for&#x2D;each/xsl:element/xsl:for&#x2D;each" x="232" y="159"/><block path="xsl:element/xsl:for&#x2D;each/xsl:element/xsl:for&#x2D;each/xsl:element/xsl:for&#x2D;each/xsl:attribute/xsl:value&#x2D;of" x="263" y="171"/><block path="xsl:element/xsl:for&#x2D;each/xsl:element/xsl:for&#x2D;each/xsl:element/xsl:for&#x2D;each[1]" x="154" y="164"/><block path="xsl:element/xsl:for&#x2D;each/xsl:element/xsl:for&#x2D;each/xsl:element/xsl:for&#x2D;each[1]/xsl:element/xsl:attribute[2]/xsl:value&#x2D;of" x="297" y="223"/><block path="xsl:element/xsl:for&#x2D;each/xsl:element/xsl:for&#x2D;each/xsl:element/xsl:for&#x2D;each[1]/xsl:element/xsl:attribute[2]/xsl:value&#x2D;of[1]" x="249" y="245"/></template></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->