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

Splitting Data into Two Sets, iterating over one

Subject: Splitting Data into Two Sets, iterating over one
From: "Daniel Johnson" <djohnson@xxxxxxxxxx>
Date: Wed, 20 Jun 2007 20:49:42 -0700
 Splitting Data into Two Sets
This is a follow-on question from an earlier posting of mine on how to
generate a product-comparison table (the advice there was a very good
push in the right direction, thanks!)
http://www.biglist.com/lists/xsl-list/archives/200706/msg00228.html

I have several lists of data elements in the following format, one in
each file:

<nodes>
  <node value="name1 arbitrary_data_string1">
  <node value="name2 arbitrary_data_string2">
  ...
</nodes>


Ideally, the data would just be in separate attributes but this is not
what the format is...

If I had the data seperated as <item name="name" value="value"> I'd know
what to do now, use distinct-values($files/nodes/node/@name) to get a
list of all possible names, then use the list of names to retrieve the
values for the table.

Now however, the name and corresponding data are combined. I figured out
how to extract the data name/value pairs from the string using the
<xsl:analyze-string> and a regex. (analyze-string doesn't seem to take
in multiple values, I tried passing $files/nodes/node/@name ) I am able
to print out all of the Name/Value pairs when doing this...However, I
don't know how to somehow store this as an array ("sequence"?) or
associate these new separate data lists so I can do a name->value
lookup.

Once I have a list of all possible unique "names", I would like to
iterate across this list and select the corresponding "value" from each
file for the table (or, again 'N/A' if not present).

It'd be ideal if I could somehow make it look just like <item
name="name" value="value"> somehow since the rest of my code supports
this format already, but really anything that can let me easily generate
a table with all possible unique names and corresponding values is good
enough.

Thanks,

Dan


-----------------------------------------------------------------------------
------
This email message is for the sole use of the intended recipient(s) and may
contain
confidential information.  Any unauthorized review, use, disclosure or
distribution
is prohibited.  If you are not the intended recipient, please contact the
sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------
------

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.