I’ve struggled some time now. I just started with xslt, and I got things working just fine. Templates are used wherever possible and I’ve tried to keep myself from using for-loops.
My problem is this: I have a number of nodes with similar names, only difference is a postfix number from 1 to (currently) 5. These should all be transformed into a node without the numbers. So basically, here is what I have:
<title1>some title</title1>
<some_other_nodes>....</some_other_nodes>
<title2>some title2</title2>
.
.
.
<title5>....</title5>
And this is what I want:
<title>some title</title>
.
.
.
<title>some title2</title>
.
.
.
<title>....</title>
Is it possible to do substring matching with templates (matching just the title-part)?
Thanks for your help!
For elements of the form titleN, where N is some number, use a match condition like …
(corrected:)
Less generically, but quick and dirty, if you want SPECIFICALLY title1 through to title5, you might also think about …