[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

[no subject]

position a cell in xsl

<row>

<cell>

<cell @start> "when row/entry/@morerows is found create the @start  -
identified row, position 2 cell"

<cell>

</row>



<row>

<cell>

<cell> "first row following, position 2 cell"

<cell>

</row>



<row>

<cell>

<cell @end> "second row following, position 2 cell

<cell>

</row>





----my transform---


<xsl:template match="row">

<xsl:param name="rowPos">
	<xsl:choose>
			<xsl:when test=".[entry/@morerows]">

		 <xsl:apply-templates select="entry/@morerows"/>

		 	</xsl:when>
		</xsl:choose>
</xsl:param>



<xsl:param name="entryPos">
<xsl:for-each select="entry">
<xsl:choose>
	<xsl:when test="@morerows">
<xsl:value-of select="position()"/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:param>

<xsl:param name="currentRow">
<xsl:value-of select="position()"/>
</xsl:param>

<xsl:param name="endRow">
<xsl:value-of select="number($rowPos) + 1"/>
</xsl:param>

<!--
<xsl:variable name="static">
<xsl:choose>
	<xsl:when test="./entry/@morerows">
<xsl:value-of
select="ancestor::tbody/row[position()]/entry/@morerows"/></xsl:when>
</xsl:choose>
</xsl:variable>

Static: <xsl:value-of select="$static"/>-->

Current Row <xsl:value-of select="number($currentRow)"/>
Entry Position: <xsl:value-of select="number($entryPos)"/>
@Morerows Value: <xsl:value-of select="number($rowPos)"/>
Where to add attribute: Row # <xsl:value-of select="number($endRow) "/>.
(Cell) Entry Position # <xsl:value-of select="number($entryPos)"/>



------end transform-----

-----start xml------------

	<table-wrapper>
			<table>
				<tgroup cols="5">
					<!--<colspec colwidth="10"
colname="col1"/>
					<colspec colwidth="11"
colname="col2"/>
					<colspec colwidth="12"
colname="col3"/>
					<colspec colwidth="13"
colname="col4"/>
					<colspec colwidth="14"
colname="col5"/>-->
					<tbody>
						<row>

<entry>first</entry>

<entry>second</entry>
							<entry
morerows="4">first row-third entry | </entry>
							<entry>3</entry>
							<entry>4</entry>
						</row>
						<row>
							<entry>1</entry>
							<entry>2</entry>
							<entry>second
row-third entry | </entry>
							<entry>4</entry>
						</row>
						<row>
							<entry>1</entry>
							<entry>2</entry>
							<entry>third
row-third entry | </entry>
							<entry>4</entry>
						</row>
						<row>
							<entry
namest="col1" nameend="col4" morerows="2">1</entry>
							<entry>2</entry>
							<entry>fourth
row-third entry | </entry>
						</row>
						<row>
							<entry>1</entry>
							<entry>2</entry>
							<entry>fifth
row-third entry | </entry>
							<entry>4</entry>
						</row>
						<row>
							<entry
namest="col1" nameend="col4" morerows="1">1</entry>
							<entry>2</entry>
							<entry>sixth
row-third entry | </entry>
						</row>
						<row>
							<entry>1</entry>
							<entry>1</entry>
							<entry>seventh
row-third entry | </entry>
						</row>
						<row>
							<entry/>
							<entry/>
							<entry>eighth
row-third entry |</entry>
						</row>
					</tbody>
				</tgroup>
			</table>
		</table-wrapper>

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.