Grouping XSLT nodes via transformation dynamically
- by scott
I'm trying to create a page like this via XSLT transformation.
Pages
page1
page2
Links
link1
link2
Here is the xml
<siteMenu>
<Pages>
<title>page1</title>
</Pages>
<Pages>
<title>page2</title>
</Pages>
<Links>
<title>link1</title>
</Links>
<Links>
<title>link2</title>
</Links>
</siteMenu>
I tried using
<xsl:for-each select="*"> and <xsl:for-each-group select="*" group-by="@v">
but that gives me every element, but how can i separate them out based on the parent node?
I also want to make it dynamic so that if I add another item in siteMenu, it would update the xslt appropriately.