[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

Subject: Applying a selection pattern on a note set constructed in the XSL sheet
From: "Maxime Levesque" <maximel@xxxxxxxxxxxxxx>
Date: Fri, 16 Jul 1999 11:27:40 -0700
selection pattern



<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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.