Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 18th, 2004, 09:57 PM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Structuring Recordset data

Hi,

I need to dynamically build a form with dropdown boxes, that have been defined by the user. So there can be 1 or more drop downs, each with 1 or more options. The source data is being fetched from a database, so is in a flat (record set styled) structure.

For example I need to convert:
<rs:row FieldName="cars" Value="Volvo"/>
<rs:row FieldName="cars" Value="Saab"/>
<rs:row FieldName="cars" Value="Fiat"/>
<rs:row FieldName="Color" Value="red"/>
<rs:row FieldName="Color" Value="green"/>
<rs:row FieldName="Color" Value="blue"/>

Into:
<form>
 <select name="cars">
  <option value="volvo">Volvo
  <option value="saab">Saab
  <option value="fiat" selected>Fiat
 </select>
 <select name="Color">
  <option value="red">red
  <option value="green">green
  <option value="blue" selected>blue
 </select>
</form>

Now I know this is just the thing that XSLT is supposed to do, but I don't know how to do it....can anyone help?

Thanks in advance,
Brendon Smith.







  #2 (permalink)  
Old January 19th, 2004, 07:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

http://www.jenitennison.com/xslt/grouping/index.html
  #3 (permalink)  
Old January 19th, 2004, 07:14 PM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, I'm going with the slow way suggested in the article, for now:

contact[not(surname = preceding-sibling::contact/surname)]

<xsl:apply-templates select="/records/contact[surname = current()/surname]" />




Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Data from Recordset vbprowanabe Pro Visual Basic 2005 1 January 17th, 2008 01:08 AM
How to bind data from a recordset to a combobox? wayne62682 Access VBA 6 April 2nd, 2006 08:45 PM
How Do I Reuse data from a RecordSet? steve456 Classic ASP Professional 2 October 21st, 2003 05:30 AM
Can't pull data from ntext field into recordset. rstelma Classic ASP Databases 1 August 26th, 2003 03:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.