XML - XSL: nummerierte Liste

Ah, ok! Wir haben etwas aneinander vorbei geredet!
Ich glaube vor allem hast du dein Problem übermäßig vereinfacht. Jetzt sehen deine Anforderungen ja ganz anders aus...

Probier's mal damit:
XML:
<xsl:template match="/test/provider">
Orte_Liste:
<xsl:variable name="locations" select="offer/location[not(@id = ../preceding-sibling::offer/location/@id)]" />
<xsl:for-each select="$locations">
  <xsl:value-of select="position()" /><xsl:text> </xsl:text>
<xsl:value-of select="@name" /><xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:for-each select="offer">
Angebot <xsl:value-of select="@name" />:
  <xsl:for-each select="location">
    <xsl:variable name="loc_id" select="@id" />
    <xsl:value-of select="count(
			  $locations
			  [not($loc_id = (preceding-sibling::location|../preceding-sibling::offer/location)/@id)])" />
  <xsl:if test="position() != last()">, </xsl:if>
  </xsl:for-each>
</xsl:for-each>

--------------------
</xsl:template>
Ausgabe bei deinem Beispiel:
Code:
Orte_Liste:
1 def
2 abc

Angebot a:
  1, 2
Angebot b:
  2
Angebot c:
  2, 1

--------------------

Orte_Liste:
1 xyz
2 uvw
3 def

Angebot d:
  1, 2
Angebot e:
  2, 3

--------------------
Gruß
 
Zuletzt bearbeitet von einem Moderator:
Hallo deepthroat,

danke für Deine Hilfe!

Das Problem hierbei war auch für mich, dass mir das ganze Probleme nicht von Anfang an bekannt war. Die einzelnen Punkte und der Aufbau der XML - Datei tröpfelten nur nach und nach zu mir durch.

Danke nochmals für Deine Hilfe :)

Grüße
saturn
 
Zurück