Grouping XSLT nodes via transformation

Posted by scott on Stack Overflow See other posts from Stack Overflow or by scott
Published on 2010-04-21T14:56:27Z Indexed on 2010/04/21 15:03 UTC
Read the original article Hit count: 242

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about xslt

Related posts about xsl