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

using XSLT to transform a XML recordset

Subject: using XSLT to transform a XML recordset
From: Svend Ezaki Tofte <set@xxxxxxxxxxx>
Date: Wed, 22 Aug 2001 13:46:08 +0200
xml recordset
I'm in the process of helping on of the s	ystems guys with a little
question
on XLST, and we're wondering if something can be done.

I have a recordset, extracted from a database, via some ASP (this is all in
MS country), we make it into a xml object. for now, I've written the
following, simple XML document:

<?xml version="1.0"?>
<data>
	<row bundle="svendtofte" reskey="description" resvalue="svends
forsoeg paa xml transformations" />
	<row bundle="svendtofte" reskey="title" resvalue="svends xml" />
	<row bundle="svendtofte" reskey="text" resvalue="davs med dig" />
	<row bundle="svendtofte" reskey="link" resvalue="et link til cnn" />
	<row bundle="mikkel" reskey="de" resvalue="et link til cnn" />
	<row bundle="mikkel" reskey="blah" resvalue="en value som svendtofte
ikke har" />
</data>

notice how, each bundle, being the main identifier, doesn't always have the
same number of resources. the idea being, that we want the base to be
flexible, so no set amount of values have been defined. Just that it always
contains a reskey (resourcekey), and a resvalue (resourcevalue), and these
properties/values are tied to a bundle name, in the above example,
"svendtofte" and "mikkel".

what we want is something like this:

<?xml version="1.0"?>
<data>
	<element
		bundle="svendtofte"
		description="svends forsoeg paa xml transformations" 
		title="svends xml"
		text="davs med dig"
		link="et link til cnn"
		de=""
		blah=""/>
	<element 
		bundle="mikkel"
		description="" 
		title=""
		text="davs med dig"
		link="et link til cnn"
		de="et link til cnn"
		blah="en value som svendtofte ikke har"/>
</data>

that is, we need each "element", to [expletive deleted] the values it has associated (via
the bundle), and all the attributes that are defined, anywhere in the
recordset, we need to set on all elements. if a element does not have a
value, for a set attribute, we need to set it to null, or something similar.
now, before I start on all this (I have alot of work, and more coming), I
just want your guess, if this is possible. The problem, as I see it, is that
you need to go over the xml document twice, once to see what values we want,
and a second time, to set them all.

Any advice, or links or code will be greatly appreciated :)

And a big hey to everybody on the list :)

-svendtofte
www.svendtofte.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.