473,322 Members | 1,714 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,322 software developers and data experts.

incrementing

I need to create unique id's for DIVs for each instance of <foo>
within each instance of <baras follows. I iterate through both the
bars and foos via <apply-templates/>. I've tried to use position() but
that reflects the current <bar>, not the current <foo>.

========= sample xml ================
<!-- note the there may be other peer elements to the FOOs -->
<root>
<bar>
<foo>blah, blah, blah</foo>
<foo>bebop, smooth, cool, swing, super cool</foo>
</bar>
<bar>
<foo>baroque, classical, modern</foo>
<foo>chicago, delta</foo>
</bar>
</root>
==================================

========= sample html ================
page generated for the first <barinstance:
<html>
<body>
<div id="foo1">blah, blah, blah</div>
<div id="foo2">bebop, smooth, cool, swing, super cool</div>
</body>
</html>

page generated for the second <barinstance:
<html>
<body>
<div id="foo1">baroque, classical, modern</div>
<div id="foo2">chicago, delta</div>
</body>
</html>
=================================
Jul 1 '08 #1
1 1423
In article <8c**********************************@w5g2000prd.g ooglegroups.com>,
David Schwartz <da******@gmail.comwrote:
>I need to create unique id's for DIVs for each instance of <foo>
within each instance of <baras follows.
Use generate-id().

If you really need the position of <foowithin the whole document,
you could use count(preceding::foo), but it will be potentially
very slow.

-- Richard
--
Please remember to mention me / in tapes you leave behind.
Jul 1 '08 #2

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

Similar topics

2
by: Tom | last post by:
Anyone help on this? PHP/MySQL I have a repeat region displaying records from orders in a CSV format: CalJoe33,18,08/23/2004,FED EX,PREPAID,WEBSITE,CA,Book,25.95,??? CalJoe33,18,08/23/2004,FED...
3
by: Mothra | last post by:
Here's what I'm trying to do (kill off old Unix logins): --------------------- $i=0; while (<$who>) { chomp($_); my @line = split(/\s+/, $_); # Split it into an array next unless ($line...
2
by: Mike Brearley | last post by:
I have a counter (alright one I found on asp101.com) that checks for a session variable to prevent the counter from incrmenting if a user refreshes the page or returns to the page during the same...
6
by: J. Campbell | last post by:
Hi everyone. I'm sure that this is common knowledge for many/most here. However, it was rather illuminating for me (someone learning c++) and I thought it might be helpful for someone else. I'm...
2
by: brian | last post by:
Hi, before coming to .NET, I utilized regular expressions mostly in JScript / JavaScript and also in my favorite text editor: TextPad (www.textpad.com) I don't know about JScript/JavaScript, but...
10
by: Antanas | last post by:
The problem is that when AddID is used multiple times in the same select statement, it returns the same value in all places. How could I force function AddID to increment OBJECTID sequence? Here...
2
by: Payson Books | last post by:
Where can I find some info on grabbing the recordID of the last record, incrementing it by one, and using the new number in a new record.
26
by: Bas Wassink | last post by:
Hi there, Does the ANSI standard say anything about incrementing variables past their limits ? When I compile code like this: unsigned char x = 255; x++; printf ( "%d\n", x );
53
by: subramanian100in | last post by:
I saw this question from www.brainbench.com void *ptr; myStruct myArray; ptr = myArray; Which of the following is the correct way to increment the variable "ptr"? Choice 1 ptr = ptr +...
9
by: subramanian100in | last post by:
The following portion is from c-faq.com - comp.lang.c FAQ list · Question 6.13 int a1 = {0, 1, 2}; int a2 = {{3, 4, 5}, {6, 7, 8}}; int *ip; /* pointer to int */ int (*ap); /* pointer to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.