RE: [xsl] table/matrix and xpath prob

Subject: RE: [xsl] table/matrix and xpath prob
From: Américo Albuquerque <melinor@xxxxxxxx>
Date: Sun, 29 Feb 2004 20:58:18 -0000

It seems that no one have replied to this message yet

So, here is a possible solution:

<x:key name="words" match="word"
use="concat(generate-id(parent::variant),' ',.)"/>
 <x:template match="variables">
  <x:variable name="var"
rds',concat(generate-id(parent::variant),' ',.)))]"/>
    <x:apply-templates select="$var"/>
    <x:with-param name="var" select="$var"/>
 <x:template match="word">
  <td><x:value-of select="."/></td>
 <x:template match="location">
  <x:param name="var" select="."/>
  <x:param name="id" select="id"/>
   <td><x:apply-templates select="placename"/></td>
   <x:apply-templates select="$var/parent::variant">
    <x:with-param name="id" select="$id"/>
 <x:template match="variant">
  <x:param name="id" select="0"/>
   <x:when test="$id=locations/location">
   <x:value-of select="$id"/>

Americo Albuquerque

-----Mensagem original-----
De: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] Em nome de
Enviada: terça-feira, 10 de Fevereiro de 2004 18:46
Para: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Assunto: [xsl] table/matrix and xpath prob

I'm battling with the following problem. I have two xml-files; on one
I'm doing the transformation and the other one is imported with
document(). The structure of the first file is as follows:


I want to do a table in which all the placenames from the second file
are listed, followed by columns for each variant (as many columns as
there are variants) from the first file. So far so good. I want to fill
the columns with cells with the location value from the first file but
only where this number matches the id number from the locations list. If
there's no match, the cell should remain empty. What I have so far (not
working) is:


I can't get the xpath for the last for-each-set right. I know that I
have to somehow match the location with the id from the imported file in
order to get a matrix like this:

placename	foo	oof
London	1	-
Tokyo		-	2

I'm using MSXML and IE6. Has anyone got any idea how this might be
solved? Much appreciated. 


 XSL-List info and archive:

 XSL-List info and archive:

Current Thread