[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Sorting a variable that contains a nodeset
From: "cutlass" <cutlass@xxxxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: Re: Sorting a variable that contains a nodeset Date: Thu, 10 Jan 2002 16:11:35 -0000 My XML file is: <ALMACEN> <ARTICULO> <DESCRIPCION_CORTA>chuletas cerdo</DESCRIPCION_CORTA> <DESCRIPCION_LARGA>chuletas cerdo extra</DESCRIPCION_LARGA> <NOMBRE_FAMILIA>alimentacion</NOMBRE_FAMILIA> <NOMBRE_SUBFAMILIA>carnes</NOMBRE_SUBFAMILIA> </ARTICULO> <ARTICULO> <DESCRIPCION_CORTA>chuletas marrano</DESCRIPCION_CORTA> <DESCRIPCION_LARGA>chuletas marrano extra</DESCRIPCION_LARGA> <NOMBRE_FAMILIA>alimentacion</NOMBRE_FAMILIA> <NOMBRE_SUBFAMILIA>verduras</NOMBRE_SUBFAMILIA> </ARTICULO> <ALMACEN> And I want to show this information sorted in a HTML table. I perform this with the code: <xsl:template match="/ALMACEN"> <xsl:for-each select="ARTICULO"> <xsl:sort select="NOMBRE_FAMILIA"/> <xsl:sort select="NOMBRE_SUBFAMILIA"/> <xsl:sort select="DESCRIPCION_CORTA"/> ... </xsl:for-each> </xsl:template> My problem is that I have to compare each 'ARTICULO' with the following 'ARTICULO', but once they are sorted. For this, I think the best solution is to store in a variable all the nodes 'ARTICULO', sort them, and compare each of them with the following. The variable is formed as: <xsl:variable name="nodos" select="//ARTICULO"/> I hope you have enought information with it, otherwise I´ll be pleased to give it to you. Thanks friend! _________________________________________________________________ MSN Photos es la manera más sencilla de compartir e imprimir sus fotos: http://photos.latam.msn.com/Support/WorldWide.aspx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|