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

Converting a SQL XML Resultset using XSL...

Subject: Converting a SQL XML Resultset using XSL...
From: "SANSONE, AARON M [Non-Pharmacia/1000]" <aaron.m.sansone@xxxxxxxxxxxx>
Date: Thu, 28 Feb 2002 11:35:39 -0600
converting resultset to xml
We are trying to convert a SQL Result set that is in XML to a business layer
XML Format.  We are having trouble trying to get the correct Stylesheet to
generate the desired result.  We have a kludge of for-each loops and xsl
keys that I am reluctant to show you here (fear of confusion).  This is a
tabular view of a sinpet of what the SQL Query returns:

id		display_name	tag_name	tmp_name	score
253241	Test1			XXX15		C		1
253241	Test1			XXX15		T		0
253241	Test1			XXX55		G		1
253241	Test1			XXX55		T		0
...
253242	Test2			XXX15		C		4
253242	Test2			XXX15		T		3

Here is a snipet of our XML Result set (based on the above query results):

<?xml version="1.0"?>
<page>
	<rowset name="scores">
		<row>
			<id>253241</id>
			<display_name>Test1</display_name>
			<tag_name>XXX15</tag_name>
			<tmp_name>C</tmp_name>
			<score>1</score>
		</row>
		<row>
			<id>253241</id>
			<display_name>Test1</display_name>
			<tag_name>XXX15</tag_name>
			<tmp_name>T</tmp_name>
			<score>0</score>
		</row>
		<row>
			<id>253241</id>
			<display_name>Test1</display_name>
			<tag_name>XXX55</tag_name>
			<tmp_name>G</tmp_name>
			<score>1</score>
		</row>
		<row>
			<id>253241</id>
			<display_name>Test1</display_name>
			<tag_name>XXX55</tag_name>
			<tmp_name>T</tmp_name>
			<score>0</score>
		</row>

		...

		<row>
			<id>253242</id>
			<display_name>Test2</display_name>
			<tag_name>XXX15</tag_name>
			<tmp_name>C</tmp_name>
			<score>4</score>
		</row>
		<row>
			<id>253242</id>
			<display_name>Test2</display_name>
			<tag_name>XXX15</tag_name>
			<tmp_name>T</tmp_name>
			<score>3</score>
		</row>
	</rowset>
</page>


After applying the stylesheet we would like the following result:


<individual id="253241" name="Test1">
	<tag name="XXX15">
		<tmp name="C" score="1"/>
		<tmp name="T" score="0"/>
	</tag>
	<tag name="XXX55">
		<tmp name="G" score="1"/>
		<tmp name="T" score="0"/>
	</tag>
</individual>
...
<individual id="253242" name="Test2">
	<tag name="XXX15">
		<tmp name="C" score="4"/>
		<tmp name="T" score="3"/>
	</tag>
</individual>


Can anyone offer some assistance?  If you really want our current (non
working) xsl I could post that...

Thanks,

Aaron

 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.