Subject: [xsl] Splitting Data into Two Sets, iterating over one From: "Daniel Johnson" <djohnson@xxxxxxxxxx> Date: Wed, 20 Jun 2007 20:49:42 -0700 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Looking Not Working for N, Michael Kay | Thread | Re: [xsl] Splitting Data into Two S, Abel Braaksma (onlin |
Re: [xsl] Sorting in A for-each-gro, Jeff Sese | Date | Re: [xsl] Getting a list of node Te, Nicholas Orr |
Month |