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

use of xsl:key in cross-referencing

Subject: use of xsl:key in cross-referencing
From: Xiaocun Xu <xiaocunxu@xxxxxxxxx>
Date: Sat, 15 Mar 2003 12:35:11 -0800 (PST)
xsl cross referencing
Hi, All:

I have a problem related to cross referencing.

I have two groups of <row> elements in which the first
group are questionnaires and second group are
questions within the questionnaires (defined in the
first group).  The first <cell> element of the
question group cross references to the second <cell>
element of the questionnaire group.  For example, the
below XML, row 28 and 29 cell 1 "References" cross
references to row 16 cell 2.
<row row="16">
	<cell column="1">References Name</cell>
	<cell column="2">References</cell>
	<cell column="3">References Description</cell>
</row>
...<rows in between skipped for brevity>...
<row row="28">
	<cell column="1">References</cell>
	<cell column="2">text of Question 8<cell>
</row>
<row row="29">
	<cell column="1">References</cell>
	<cell column="2">text of Question 9</cell>
</row>
Relationship of questionnaire to question is one to
many, so each questionnaire should appear only once in
the 1st group; but in the 2nd group, multiple
questions could refer to the same questionnaire.

The way I currently handles it is create a xsl:key
matching rows in the 2nd group (questions) using the
1st cell.  When I process the 1st group of rows
(questionnaires), I call key() function by passing in
the value in the 2nd cell.  The problem with this
approach is that it ignores question with a
questionnaire not defined in the 1st group.  Is there
an elegant way to address this problem?

Much thanks,
Xiaocun Xu

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.