xsl-list
[Top] [All Lists]

Re: [xsl] template to group by tags

2008-08-19 03:47:17
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/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>