ThomasM: XML Einträge Gruppieren

Beitrag lesen

Hallo Mobby,

probiere diesen Ansatz:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xpath-default-namespace="http://www.filemaker.com/fmpdsoresult"
  xmlns="http://www.filemaker.com/fmpdsoresult">

  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

  <xsl:template match="FMPDSORESULT">
    <FMPDSORESULT>
      <xsl:for-each-group select="ROW" group-by="Hauptartikel">
        <xsl:for-each select="current-group()[1]">
          <ROW>
            <Hauptartikel>
              <xsl:value-of select="Hauptartikel"/>
            </Hauptartikel>
            <xsl:for-each select="current-group()">
              <ROW2>
                <xsl:copy-of select="Hauptartikel/following-sibling::*"/>
              </ROW2>
            </xsl:for-each>
          </ROW>
        </xsl:for-each>
      </xsl:for-each-group>
    </FMPDSORESULT>
  </xsl:template>

</xsl:stylesheet>

Grüße,
Thomas