Subject: Re: retrieve data from #1 xml via data from #2 xml
From: "Walter Torres" <walter@xxxxxxxxx>
Date: Thu, 22 Mar 2001 14:56:53 -0600
|
I need to beat this dead horse one more time, please...
> -----Original Message-----
> From: Jeni Tennison [mailto:mail@xxxxxxxxxxxxxxxx]
> Sent: Wednesday, March 14, 2001 10:58 PM
> To: Walter Torres
> Cc: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: retrive data from #1 xml via data from #2 xml
I defined my variables thus...
<xsl:variable name="data"
select="/callEvent//interaction" />
<xsl:variable name="columns"
select="document('tableData.xml')/titles/display/@id" />
This works nice.
I get data as I think I should.
> So if you want to iterate over the interaction elements, then you can
> either change it so that the node that the column ids are resolved
> relative to are the events/call_event grandchildren of the interaction
> element with:
>
> <tr>
> <xsl:for-each select="$data">
> <xsl:variable name="datum" select="events/call_event" />
> <xsl:for-each select="$columns">
> <xsl:variable name="column" select="." />
> <td>
> <xsl:value-of select="$datum/*[name() = $column]" />
> </td>
> </xsl:for-each>
> </xsl:for-each>
> </tr>
I finally get what this is doing!
But it's not helping, (well, it mostly is but...)
[ My dummy data has 3 records, 12 fields
My tabelData has 6 of the above 12 fields
Thats all I want to see, a sub set
]
My problem with this is that when I run this, I get 3 rows, as I should
but I also get all 12 fields, not just the 6 as defined in tableData.
So I figure I need some conditional in here to see if the current NODE is
part of the tableData NODE set.
I just can't figure how to get that piece of info out of the 'variable' set
I have.
After several days of banging my head against the wall I thought I would ask
for help (again!).
Walter
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|