I need to remove the bullet after the final item in the list. The test="position()!=last() is not working (I get a bullet on every item, including the last). I'm not sure how to do this type of test because in this particular scenario there is no for-each loop..
The problem with this is that it's tecnically working - just not the way we'd like it to...
When the apply-templates instruction is executed, a nodeset is created (from the nodes matched by the expression in the select attribute) - that nodeset is then "the current node list", which position() values are then based on, and thus the last() function. Problem is, the set you're running through is all the prevalues - go see what the last prevalue in the dropdown is, and check if it gets a bullet where it's used - it most likely won't.
To get the result you're after, you would need to create a set set of the actual preValues that's in use, which seems to require some sort of grouping, unless we're able to get the usage into the select in the apply-templates instruction.
EDIT:
So I've tried a couple of things, which didn't work - but really, are you sure you shouldn't just do this with CSS? When the HTML has been generated, finding the last item is just a :last-child selector away, depending on your browser compatibility requirements...
Remove final bullet (or comma) from last unordered list item
I have a horizontal two-level unordered list, with a bullet between each sub item. The list is generated by the following XSLT:
I need to remove the bullet after the final item in the list. The test="position()!=last() is not working (I get a bullet on every item, including the last). I'm not sure how to do this type of test because in this particular scenario there is no for-each loop..
Hi Laura,
The problem with this is that it's tecnically working - just not the way we'd like it to...
When the apply-templates instruction is executed, a nodeset is created (from the nodes matched by the expression in the select attribute) - that nodeset is then "the current node list", which position() values are then based on, and thus the last() function. Problem is, the set you're running through is all the prevalues - go see what the last prevalue in the dropdown is, and check if it gets a bullet where it's used - it most likely won't.
To get the result you're after, you would need to create a set set of the actual preValues that's in use, which seems to require some sort of grouping, unless we're able to get the usage into the select in the apply-templates instruction.
EDIT:
So I've tried a couple of things, which didn't work - but really, are you sure you shouldn't just do this with CSS? When the HTML has been generated, finding the last item is just a :last-child selector away, depending on your browser compatibility requirements...
/Chriztian
is working on a reply...