Re: [xsl] template to group by tags

Subject: Re: [xsl] template to group by tags
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Tue, 19 Aug 2008 12:46:47 +0200
IZASKUN GUTIERREZ GUTIERREZ wrote:

I need one templete 1.0 or 2.0 to group tags author and editor like this, grouping the values by the word and:

Here is an XSLT 2.0 stylesheet:


<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  xpath-default-namespace="http://bibtexml.sf.net/";
  xmlns="http://bibtexml.sf.net/";
  version="2.0">

  <xsl:output indent="yes"/>
  <xsl:strip-space elements="*"/>

  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="article | book">
    <xsl:copy>
      <xsl:apply-templates select="@*"/>
      <author>
        <xsl:value-of select="author" separator=" and "/>
      </author>
      <editor>
        <xsl:value-of select="editor" separator=" and "/>
      </editor>
      <xsl:apply-templates select="*[not(self::author or self::editor)]"/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>


--


	Martin Honnen
	http://JavaScript.FAQTs.com/

Current Thread