The variable example works, but there is a much easier way to do it (in my opinion). Let's say, in your XML, you have the element "events" repeating 31 times -- indicating 31 events -- and you want each one to have a unique ID.
In your XSL sheet, you'd run a loop creating a <div> like this:
The reason I pointed to the variable option, is that the question is not clear. If there is only one loop, then yes, I agree with you. If there are more however, the position will not give the desired results.
That could work, but the problem becomes if you want to do anything with CSS. For instance, if you wanted to alternate background colors for even and odd-numbered <div>'s, you couldn't with the generateid() function, since it creates a random ID. By using a variable, you can check the position() and create an attribute that determines whether a <div> is even or odd numbered. Still, good contribution and it might be exactly what they're looking for!
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...