I have a XML hierarchy just like this one:
<main-parent>
<child>
<element1>...</element1>
<element2>...</element2>
</child>
<child>
<element1>...</element1>
<element2>...</element2>
</child>
<child>
<element1>...</element1>
<element2>...</element2>
</child>
</main-parent>
In XSL, I'm trying to retrieve element1 and element2 tag names and make them table-headers(th) in a table. How can I do this? Using xsl:for-each in above example, on the main-parent/child, there will be 6 th's(2 in every child element) and that's not what I want. I just want to get element1 and element2 tag names. Inside xsl:template I am using xhtml(html, head and body elements) and creating the table in body element with table tag(just like in any html).