AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

XSL Problem

Ein Thema von Mussi0 · begonnen am 27. Aug 2007 · letzter Beitrag vom 30. Aug 2007
 
Mussi0

Registriert seit: 8. Jun 2006
55 Beiträge
 
#1

XSL Problem

  Alt 27. Aug 2007, 20:00
Hallo zusammen,

ich habe ein Problem mit einem XSL-Template und habe ich folgende XML Datei:

XML-Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<catalog>
  <cd num="0">
    <title>Empire Burlesque</title>
    <artist>Bob Dylan</artist>
    <country>USA</country>
    <company>Columbia</company>
    <preis>
         <npreis id="0">10</npreis>
         <nstaffel id="0">1</nstaffel>      
         <npreis id="1">8</npreis>
         <nstaffel id="1">2</nstaffel>            
    </preis>
    <year>1985</year>
  </cd>
  <cd num="1">
    <title>Empire Burlesque</title>
    <artist>Bob Dylan</artist>
    <country>USA</country>
    <company>Columbia</company>
    <preis>
         <npreis id="0">20</npreis>
         <nstaffel id="0">1</nstaffel>      
         <npreis id="1">16</npreis>
         <nstaffel id="1">2</nstaffel>            
    </preis>
    <year>1985</year>
  </cd>
  <cd num="2">
    <title>Empire Burlesque</title>
    <artist>Bob Dylan</artist>
    <country>USA</country>
    <company>Columbia</company>
    <preis>
         <npreis id="0">30</npreis>
         <nstaffel id="0">1</nstaffel>      
         <npreis id="1">24</npreis>
         <nstaffel id="1">2</nstaffel>            
    </preis>
    <year>1985</year>
  </cd>
</catalog>
Und folgende XSL Datei:

XML-Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
  <html>
  <body>
    <h2>My CD Collection</h2>
    <table border="1">
    <tr bgcolor="#AAAAAA">
      <th align="left">Title</th>
      <th align="left">Artist</th>
      <th align="left">Preis</th>
      <th align="left">Staffel Preis</th>
    </tr>
    <xsl:for-each select="catalog/cd">
    <tr>
      <td><xsl:value-of select="title"/></td>
      <td><xsl:value-of select="artist"/></td>
      <xsl:for-each select="preis">
            <xsl:if test="catalog/cd/preis/nstaffel[@id='1']">
               <td colspan="2"></td>
             </xsl:if>
         <td><xsl:value-of select="npreis"/></td>
            <td><xsl:value-of select="nstaffel"/></td>
         </xsl:for-each>
    </tr>
    </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>

</xsl:stylesheet>
Nun möchte ich zu jeden Artist beide Preise bekommen und zwar untereinander.

Leider funktioniert das so wie ich das gemacht habe nicht und ich weiß nicht warum!!

Gruß und Dank für eure Hilfe!!!

muss!0
Wer die anderen neben sich klein macht ist nie groß.
von Johann Gottfried Seume

Website: http://mussio.funpic.de
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:36 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz