Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 16th, 2014, 04:01 AM
Registered User
 
Join Date: Mar 2014
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default cell/struct with dynamic dim

Hi,

I want to generate something like that:

HTML Code:
<xsl:variable name="U" select="count($TEST)"/>


<cell dim="U 1">                                %%% so the Dimension should be dynamic
	<xsl:for-each select="$TEST[position() mod 7 =1]">


		
		<struct dim="1 1">
		<rec>
..............
the Problem is the part: <cell dim= "U 1">, how can i manage to get the number of U in there?
 
Old April 16th, 2014, 04:04 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Code:
<cell dim="{$U} 1">
or

Code:
<cell>
   <xsl:attribute name="dim"><xsl:value-of select="$U"/> 1</xsl:attribute>
   ...
</cell>
Obviously the first one is simpler and cleaner, but the second would give you more flexibility when you aren't simply outputting a single variable.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
The Following User Says Thank You to samjudson For This Useful Post:
Jenny91 (April 16th, 2014)





Similar Threads
Thread Thread Starter Forum Replies Last Post
<struct><cell> tagging list-elements Jenny91 XSLT 2 March 26th, 2014 05:19 PM
Dynamic Hyperlink Based on 2 x Cell value kevinm12 Excel VBA 1 December 19th, 2012 05:00 PM
The origin of the "DIM" keyword RGCook BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 9 February 6th, 2009 09:03 AM
Dynamic array of struct bobwrx C# 2 September 14th, 2006 06:12 AM
Can't DIM database object egolsen Access VBA 2 September 26th, 2005 04:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.