This is my first time doing anything with XSLT, or XML really, so please excuse me. I\'ve found XSLT web documentation is really terse.
I have an XML file that I want to
I've worked out how to do it as below, but some parts such as the "contents" variable didn't seem like the best way to handle this.
Well, basically you got it right. You can still improve it a little, though:
The
changes the context node. Within it, the .
refers to the node being iterated over, not the one that had been matched by the
.
That means you have to preseve the "outer" context in a variable, this is standard practice.