473,569 Members | 2,845 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="descendi ng" />
<xsl:call-template name="GenerateS ection">
<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 932
I figured out how to do it. I came across the position() function, and just
tested for 1.

Richard
"Richard L Rosenheim" <ri*****@rlr.co m> wrote in message
news:uB******** *****@tk2msftng p13.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="descendi ng" />
<xsl:call-template name="GenerateS ection">
<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
1689
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 the data into Database. Now after saving the details the same page gets rendered to the user. If the user refreshes the browser as its a post - back...
4
3277
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 errors. After reading the ole object from db, I saved it to C: as file1.bmp and displayed on the web. But it can not be displayed. After I manually sent...
0
3921
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. It is almost like it is trying to implement it's own COM interfaces... below is the header, and a link to the dll+code: Zip file with header,...
2
4433
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 */ #include <time.h>
7
2292
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, the other in which I close the FileStream afterwards, although both return the same error. Here are the two versions of the code and the errors they...
7
2038
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 method creates a new object (a Matrix) for it. I suppose that after the new operator, my pointer is pointing to an object, so when the method has...
5
3521
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: Current entry Company : entered co. name First entry : entered stuff The second entry: more entered stuff
4
3969
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 but when he runs the stored procedure, he gets the following error message. "SYSPROC".CSGCSB54 - Run started. Data returned in result sets is...
3
2428
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 software test data. Each instance of a test is associated with a "test case", that is, a test item. Each test instance (or "run") may have a number of...
0
7922
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8119
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7668
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6281
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2111
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 we have to send another system
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.