xsl-list
[Top] [All Lists]

[xsl] for-each-group

2007-03-27 12:25:14
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm trying to transform the following XML:

<products>
  <product>1</product>
  <product>1</product>
  <product>1</product>
  <product>1</product>
  <product>1</product>
  <product>1</product>
  <product>1</product>
  <product>2</product>
  <product>2</product>
  <product>2</product>
  <product>2</product>
  <product>2</product>
  <product>2</product>
  <product>2</product>
  <product>2</product>
  <product>2</product>
</products>

to:

<products>
  <product>1</product>
  <product>2</product>
</products>

using:

<products>
<xsl:for-each-group select="/products" group-by="product">
  <product><xsl:value-of select="product" /></product>
</xsl:for-each-group>
</products>

What am I doing wrong?  Basically I want something similar to 'GROUP BY'
 in SQL.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGCW+AkAu83kdgE3MRArfOAKCu2SzjWaqQt9GtHt7N/XielwUCZACdGHSg
YKXjGT0JUVuxEcc/ntWPInI=
=qeAN
-----END PGP SIGNATURE-----

--~------------------------------------------------------------------
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>