|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Applying a selection pattern on a note set constructed in th
<xsl:template match="TABLE" name="merge_table">
<xsl:variable name="t">
<TABLE>
<TR>
<TD>B1.1</TD>
<TD>B1.2</TD>
</TR>
<TR>
<TD>B2.1</TD>
<TD>B2.2</TD>
</TR>
</TABLE>
</xsl:variable>
<!-- let's say that we have matched a 4x4 table.
I'd like to 'merge' it with the table assigned to $t
by merging i mean concatenating the content
of every cell of "." with it's corresponding
cell in $t
... ->
<TABLE>
<xsl:for-each select="TR">
<xsl:variable name="i" expr="position()"/>
<TR>
<xsl:for-each select="TD">
<xsl:variable name="j" expr="position()"/>
<TD><xsl:value-of select=".">
<!-- This is where I either
violate the XSL standard or do something wrong -->
<!-- begin heresy ... -->
<xsl:value-of select="$t/tr[$i]/td[$j]">
<!-- end of heresy ... -->
</TD>
</xsl:for-each>
</TR>
</xsl:for-each>
</TABLE>
<xsl:template>
... "merge_table" applyed to :
<TABLE>
<TR>
<TD>A1.1</TD>
<TD>A1.2</TD>
</TR>
<TR>
<TD>A2.1</TD>
<TD>A2.2</TD>
</TR>
</TABLE>
... would result in :
<TABLE>
<TR>
<TD>A1.1B1.1</TD>
<TD>A1.2B1.2</TD>
</TR>
<TR>
<TD>A2.1B2.1</TD>
<TD>A2.2B2.2</TD>
</TR>
</TABLE>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








