[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Sorting and grouping unknown elements

Subject: Sorting and grouping unknown elements
From: "Claus Jessing" <claus@xxxxxxxxxx>
Date: Fri, 21 Sep 2007 13:47:35 +0200
 Sorting and grouping unknown elements
Hi gurus

I'm very new to xml/xsl transformation and am faced with the following
problem. I have an xml file with a number of rows.
Each row contains an unknown (but identical in terms of element names)
set of elements. I would like to create a drop down list
for each element below my row element.

Eg. if I had this XML:


I would like to get this html:

<select name="make">
<select name="model">
<select name="color">

And this XML:

    <address>123 Wide Av.</address>
    <address>321 Narrow St.</address>

Should produce this html:

<select name="name">
<select name="address">
   <option>123 Wide Av.</option>
   <option>321 Narrow St.</option>

I have tried with something like this and all sorts of different
tweeks but I cant get to work :(

<xsl:for-each select="row/*">
   <xsl:param name="_param" select="name()"/>
   Debug: <xsl:value-of select="$_param"/>
	<xsl:for-each select="//{name()}[not(. = following::{name()})]">
		<option><xsl:value-of select="."/></option>

Can anyone help me out here?

Thanks in advance...

Claus Jessing, jessing.dk
M: +45 6061 0101, P: +45 4461 0101
E: claus@xxxxxxxxxx, IM: claus@xxxxxxxxxx

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.