I am trying to generate HTML which will display the data from XML through XSLT. The XML contains heading tags that are dynamically generated, like h1, h2, h3, h4 etc.
Now in XSLT I want to dynamically access the h1, h2 and h3 in single for-each as the heading can be lesser in level, for example h1, h2 only or can be deeper in level like h1, h2, h3 and h4.
The output HTML may look like:
h1_value1 h1_value2 h2_valu1 h2value3 .... ..... h3_value1 h3_value2 h3_value3 h3_value4 h3_value5 .... .....
My XSLT contains a variable that is incremented up to the number of levels which we have already counted. It means that if there are 3 levels then there will h1, h2 and h3 tags in XML. So to access these tags I used concat() function in select of for-each and concatenated "h" with the variable, say j. The template will be recursively called and every time j will be increased by 1 up to the number of levels.
But using a concat() function in select of for-each gives an uncaught error. Can't I use the concat() function in select of for-each or use a variable in select of for-each that is using the concat() function?