473,503 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem saving first entry into a variable or parameter

I'm trying to create a style sheet to generate HTML output, based upon some
XML data.

I'm grouping some data, and I'm trying to get the very first entry either
just passed as a parameter, or placed into a variable (which I can then
pass). I would like to differentiate some of the formatting for the first
item. I've tried a number of things, none of which worked out.

Among other things, I tried passing the first entry as a parameter (as shown
below). For reasons I don't understand, that didn't work. SectionID and
test2 are both ending up with the same value with each iteration.

I've even tried to sort in ascending sequence and placing the last
occurrence into a parameter, as in:
<xsl:with-param name="test2" select="EntryID[last()]" />
That didn't work either.

Does anyone have any suggestions?

Here's the XSLT fragment I'm working with:

<xsl:for-each
select="/dsData/Entry[generate-id(.)=generate-id(key('vID', EntryID)[1])]">
<xsl:sort select="EntryID" order="descending" />
<xsl:call-template name="GenerateSection">
<xsl:with-param name="SectionID" select="EntryID" />
<xsl:with-param name="test2" select="EntryID[1]" />
</xsl:call-template>
</xsl:for>

Nov 12 '05 #1
1 926
I figured out how to do it. I came across the position() function, and just
tested for 1.

Richard
"Richard L Rosenheim" <ri*****@rlr.com> wrote in message
news:uB*************@tk2msftngp13.phx.gbl...
I'm trying to create a style sheet to generate HTML output, based upon some XML data.

I'm grouping some data, and I'm trying to get the very first entry either
just passed as a parameter, or placed into a variable (which I can then
pass). I would like to differentiate some of the formatting for the first
item. I've tried a number of things, none of which worked out.

Among other things, I tried passing the first entry as a parameter (as shown below). For reasons I don't understand, that didn't work. SectionID and
test2 are both ending up with the same value with each iteration.

I've even tried to sort in ascending sequence and placing the last
occurrence into a parameter, as in:
<xsl:with-param name="test2" select="EntryID[last()]" />
That didn't work either.

Does anyone have any suggestions?

Here's the XSLT fragment I'm working with:

<xsl:for-each
select="/dsData/Entry[generate-id(.)=generate-id(key('vID', EntryID)[1])]"> <xsl:sort select="EntryID" order="descending" />
<xsl:call-template name="GenerateSection">
<xsl:with-param name="SectionID" select="EntryID" />
<xsl:with-param name="test2" select="EntryID[1]" />
</xsl:call-template>
</xsl:for>

Nov 12 '05 #2

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

Similar topics

3
1686
by: Ravi | last post by:
Hi, I have a simple .aspx page where user enters data (e.g Name address, etc). At the end, he/she clicks Save button which Posts to the same page and in the Save button's click event I am saving...
4
3272
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
0
3910
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
2
4427
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c...
7
2285
by: Nathan Sokalski | last post by:
I am having a problem saving an image with the same name it originally had. I have two similar versions of my code, one in which I close the FileStream used to open the original image before saving,...
7
2030
by: Marcelo | last post by:
Hi everybody, I don't understand why I am having a problem in this code. The problem is that my pointer *phist in main method, it is declared. Then I send the pointer to my method, and this...
5
3518
by: H J van Rooyen | last post by:
Hi, I am struggling to get the pack method to do what I intend. I am trying to display user input in a seperate window, along with a little description of the field, something like this: ...
4
3964
by: nishi57 | last post by:
I hope I can get some help regarding this issue, which has been going on for a while. I have a desktop user who is having problem running "Stored Procedures". The DB2 Connect application works fine...
3
2425
prn
by: prn | last post by:
Hi folks, I've got something that's driving me crazy here. If you don't want to read a long explanation, this is not the post for you. My problematic Access app is a DB for keeping track of...
0
7194
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
7316
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...
1
6976
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
5566
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4993
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.