[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Looking for the rigth select statement


Subject: Re: [xsl] Looking for the rigth select statement
From: Sorin Marti <mas@xxxxxxxxxx>
Date: Fri, 29 Nov 2002 15:25:43 +0100

Sorry, was the wrong file!

Sorin Marti wrote:

TSchutzerWeissmann@xxxxxxxxxxxxxxxx wrote:

hi Sorin,

From the output you have you've done most of the work. What does your

current xslt look like?


That's my xsl:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:key name="deps" match="profession" use="description"/>
<xsl:template match="/">
<xsl:for-each select="departement">
<xsl:value-of select="name"/>
</xsl:for-each>
<xsl:for-each select="//departement/profession[generate-id() = generate-id(key('deps', description))]">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>


It gives out the structure right below and some salary-values which are not on the right place...

Thanks for the help

Sorin

        departement1 departement2
Manager      Assistant
Employee
Worker

that's from this xml-source:

<departement name="departement1">
<profession>
  <desc>Manager</desc>
  <salary>5000</salary>
</profession>

<profession>
  <desc>Assistant</desc>
  <salary>3000</salary>
</profession>

<profession>
  <desc>Employee</desc>
  <salary>2000</salary>
</profession>
</departement>

<departement name="departement2">
<profession>
  <desc>Manager</desc>
  <salary>6000</salary>
</profession>

<profession>
  <desc>Worker</desc>
  <salary>2000</salary>
</profession>
</departement>

[...]

Now I want to select the salary and put it to the right position. Output should be following:

    departement1 departement2  Manager     5000    6000
Assistant       3000    ...

Employee    2000    ...
Worker          ...    2000


Thanks very much


Sorin Marti


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list







XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list







XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list




Current Thread
Keywords