473,394 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Confusing incrementation

Hi,

I am generating code using xsl. I have two templates for that. One for
the name and one for the value ( these are pairs). I have checked that
maxCount is the same for both ( e.g. 4) but I get something like:

from template for names:

<sequencename>_name0
<sequencename>_name1
<sequencename>_name2
<sequencename>_name3

from template for values:

<sequencename>_value[0]
<sequencename>_value[1]
<sequencename>_value[2]
<sequencename>_value[3]
<sequencename>_value[4]

Anyone that can see why?

cheers,

//mikael

Template for names:
===================
<!-- Template that create "<sequencename>_name0", "<sequencename>_name1"..:
super(new String[] {
"scramblingCode", "noOfEAgchCodes", "eAgchCodes_name_0",
"eAgchCodes_name_1", "eAgchCodes_name_2",
"eAgchCodes_name_3", "noOfEHichERgchCodes",
"eHichERgchCodes_name_0", "eHichERgchCodes_name_1",
"eHichERgchCodes_name_2", "eHichERgchCodes_name_3",
"eulMaxTargetRtwp"
}-->
<xsl:template name="sequenceNameString">
<xsl:param name="sequenceName"/>
<xsl:param name="maxCount"/>
<xsl:param name="value"/>
<!--<xsl:param name="arrayMax" select="$maxCount"/>-->
<!--<xsl:if test="$value &lt;= $arrayMax">-->
<xsl:if test="$value &lt;= $maxCount">
<xsl:text>"</xsl:text>
<xsl:value-of select="concat(concat($sequenceName,'_name_'),$val ue)"/>
<xsl:text>"</xsl:text>
<!--<xsl:if test="$value != $arrayMax">-->
<xsl:if test="$value != $maxCount">
<xsl:text>,</xsl:text>
</xsl:if>
<xsl:call-template name="sequenceNameString">
<xsl:with-param name="value" select="$value + 1"/>
<xsl:with-param name="sequenceName" select="$sequenceName"/>
<xsl:with-param name="maxCount" select="$maxCount"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
Template for value:
===================
<xsl:template name="sequenceValueObject">
<xsl:param name="sequenceName"/>
<xsl:param name="maxCount"/>
<xsl:param name="dataType"/>
<xsl:param name="value"/>
<xsl:if test="$value &lt;= $maxCount">
<xsl:choose>
<xsl:when test="$dataType = 'long'">
<xsl:text>new Integer</xsl:text>
</xsl:when>
<xsl:when test="$dataType = 'boolean'">
<xsl:text>new Boolean</xsl:text>
</xsl:when>
<xsl:when test="$dataType = 'string'">
<xsl:text>new String</xsl:text>
</xsl:when>
<xsl:when test="$dataType = 'longlong'">
<xsl:text>new Long</xsl:text>
</xsl:when>
<xsl:otherwise><xsl:call-template name="notImplemented">
<xsl:with-param name="sequnceName" select="$sequenceName"/>
<xsl:with-param name="error" select="$dataType"/>
</xsl:call-template></xsl:otherwise>

</xsl:choose>
<xsl:text>(</xsl:text>
<xsl:value-of select="concat($sequenceName,concat('_value [',$value))"/>
<xsl:text>])</xsl:text>
<xsl:if test="$value != $maxCount">
<xsl:text>,</xsl:text>
</xsl:if>
<xsl:call-template name="sequenceValueObject">
<xsl:with-param name="sequenceName" select="$sequenceName"/>
<xsl:with-param name="value" select="$value + 1"/>
<xsl:with-param name="maxCount" select="$maxCount"/>
<xsl:with-param name="dataType" select="$dataType"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
Sep 6 '06 #1
0 990

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marc | last post by:
Hi all, I was using Tkinter.IntVar() to store values from a large list of parts that I pulled from a list. This is the code to initialize the instances: def initVariables(self): self.e =...
2
by: David MacQuigg | last post by:
I'm setting up a large hierarchy of module packages and using a variable to select which of many alternative packages to import. For example, the variable 'config.modsel' points to a particular...
1
by: MLH | last post by:
mysql -h host -u user -p Running the above command expects actual values to be substituted for host and user. User I know about. That can be root. And now I know that this root has NOTHING to do...
4
by: Mark | last post by:
I'm struggling with how to properly name a specific subset of Properties in my classes. An example will illustrate it best. Let's say you have a class named Person with the code below. Each...
2
by: Michael B. | last post by:
Hi! I have a very simple question: Is it still true that pre variable incrementation (like ++i) is faster than post incrementation (i++). I heard that in modern compilers it makes no difference...
2
by: MadCrazyNewbie | last post by:
Hi All Wonder if somebody could help me, not really in a VB sense more of a stop confused myself sort of thing. On my project I find that im flicking from bit to bit then forgetting what I...
4
by: sam | last post by:
hI, I am little confused here See i have int wordlen=10; when int s is array s++; whats the meaning of this
2
by: sanctus | last post by:
what is the difference between for(j=0;j<cl.ts->size();++j){ double l=cmbcalc->j2l; } and
7
by: Andy B | last post by:
I saw this in the set accessor of a property: Set(ByVal value As DataSet) What exactly does the stuff in the () mean? VS complained about it not being there when I took it out not knowing...
6
Dormilich
by: Dormilich | last post by:
Hi, I’ve got a mathematical script, which is currently running fine*, although it bothers me that JS does not always increment correctly. sometimes it happens that the incremented value is...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.