Re: [xsl] retrive data from #1 xml via data from #2 xml

Subject: Re: [xsl] retrive data from #1 xml via data from #2 xml
From: "Walter Torres" <walter@xxxxxxxxx>
Date: Wed, 14 Mar 2001 15:51:40 -0500
----- Original Message ----- 
From: "Jeni Tennison" <mail@xxxxxxxxxxxxxxxx>
To: "Walter Torres" <walter@xxxxxxxxx>
Cc: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, March 14, 2001 1:51 PM
Subject: Re: [xsl] retrive data from #1 xml via data from #2 xml

> Hi Walter,

Hi Jenni,


> You don't say what you've set $data and $columns to be.


 <xsl:variable name="data"
               select="/callEvent//interaction" />

 <xsl:variable name="columns"
               select="document('tableData.xml')/titles/display/@id" />

>  You need $data to hold the elements that you want to appear as rows.
>  So it needs to be:
> <xsl:variable name="data"
>    select="/callEvent/response/interaction_list/interaction/events
>               /call_event" />

Does this need to be that exact?

"/callEvent//interaction" this won't work?

> Of course you can crop the path there depending on the context when
> you're setting the variable.

"/callEvent//interaction" is this what you mean be 'cropping'?

> You need the $columns variable to hold nodes...

right, I show you that above.

> That should then work, aside from the fact that one of the display
> element's id attributes has a value of 'source/timestamp'. That's not
> the name of any of the subelements of call_event...

No, it's a subelement of 'interaction'.

> (and it can't be because it has a '/' in it).

Right, the '/' makes its it subelement, not part of the NODE name.

So I can't use this syntax?

> So I guess that you want the value of the timestamp element of the source
> element in the same interaction element as the call_event element is in. 
> You'll have to test separately for that:


<snip code>

> If you're going to be using strange paths a lot in your table
> definitions,...

'strange paths'? is '/source/timestamp' a strange path?

> rather than simply using the names of the elements under
> the call_event element, then you'll have to start using something like
> saxon:evaluate() to evaluate the strings as XPaths.  That does mean
> that you need to redefine some of it, for example rather than using:
>   'source/timestamp'
> you'd have to use the proper XPath to get from the call_event element
> to the data you wanted, i.e.:
>   'ancestor::interaction/source/timestamp'
> I hope that helps,

Yes and no.

Thanks for your help.

 XSL-List info and archive:

Current Thread