0

Trying some for a while but ain't know what to do no more. Can somebody tell me whats wrong why my code? I want like a little table within these information. 'preciate every form of help of yo guys awsedtrtfgzuhjikoplpäköjoilhgukfzdtfzgukhilöjokäpl#üäöjolhigkujfzhtgukhiljokpkäöjohilgukfzdtsretrdztfuzgiuhiljköl

<?xml version="1.0" encoding="UTF-8"?>
<xml-stylesheet type="text/xsl" href="">
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
  <head>
    <title>TEST</title>
  </head>
<body>
  <h2>Person-Information</h2>
  <table border="1">
    <tr bgcolor="#9acd32">
      <th>@person</th>
      <th>@eyecolor</th>
      <th>@job</th>
      <th>@year</th>
    </tr>
    <xsl:for-each select="catalog/cd">
    <tr>
      <td><xsl:value-of select=""/>@person</td>
      <td><xsl:value-of select=""/>@eyecolor</td>
      <td><xsl:value-of select=""/>@jobs</td>
      <td><xsl:value-of select=""/>@year</td>
    </tr>
    </xsl:for-each>
  </table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xml" href="cdcatalog.xls" version="2.0"?>
<catalog>
  <cd>
    <person>Bob Dylan</person>
    <eyecolor>brown</eyecolor>
    <job>Teacher</job>
    <year>1985</year>
  </cd>
  <cd>
    <person>Bonnie Tyler</person>
    <eyecolor>blue</eyecolor>
    <job>Author</job>
    <year>1988</year>
  </cd>
  <cd>
    <person>Dolly Parton</person>
    <eyecolor>brown</eyecolor>
    <job>Accountant</job>
    <year>1982</year>
  </cd>
  <cd>
    <person>Gary Moore</person>
    <eyecolor>blue</eyecolor>
    <job>Virgin records</job>
    <year>1990</year>
  </cd>
  <cd>
    <person>Eros Ramazzotti</person>
    <eyecolor>green</eyecolor>
    <job>Chef</job>
    <year>1997</year>
  </cd>
  <cd>
    <person>Bee Gees</person>
    <eyecolor>blue</eyecolor>
    <job>Magican</job>
    <year>1998</year>
  </cd>
  <cd>
    <person>Dr.Hook</person>
    <eyecolor>blue</eyecolor>
    <job>Doctor</job>
    <year>1973</year>
  </cd>
  <cd>
    <person>Rod Stewart</person>
    <eyecolor>blue</eyecolor>
    <job>Atlethe</job>
    <year>1990</year>
  </cd>
  <cd>
    <person>Andrea Bocelli</person>
    <eyecolor>green</eyecolor>
    <job>Pilot</job>
    <year>1996</year>
  </cd>
  <cd>
    <person>Percy Sledge</person>
    <eyecolor>brown</eyecolor>
    <job>Captain</job>
    <year>1987</year>
  </cd>
  <cd>
    <person>Savage Rose</person>
    <eyecolor>green</eyecolor>
    <job>Army</job>
    <year>1995</year>
  </cd>
  <cd>
    <person>Kenny Rogers</person>
    <eyecolor>blue</eyecolor>
    <job>Music Master</job>
    <year>1995</year>
  </cd>
  <cd>
    <person>Will Smith</person>
    <eyecolor>brown</eyecolor>
    <job>Actor</job>
    <year>1971</year>
  </cd>
  <cd>
    <person>Van Morrison</person>
    <eyecolor>blue</eyecolor>
    <job>Developer</job>
    <year>1971</year>
  </cd>
  <cd>
    <person>Jorn Hoel</person>
    <eyecolor>green</eyecolor>
    <job>Tutor</job>
    <year>1996</year>
  </cd>
  <cd>
    <person>Cat Stevens</person>
    <eyecolor>blue</eyecolor>
    <job>Painter</job>
    <year>1990</year>
  </cd>
  <cd>
    <person>Sam Brown</person>
    <eyecolor>blue</eyecolor>
    <job>Chef</job>
    <year>1988</year>
  </cd>
  <cd>
    <person>T`Pau</person>
    <eyecolor>blue</eyecolor>
    <job>Graphicdesigner</job>
    <year>1987</year>
  </cd>
  <cd>
    <person>Tina Turner</person>
    <eyecolor>blue</eyecolor>
    <job>Teacher</job>
    <year>1983</year>
  </cd>
  <cd>
    <person>Kim Larsen</person>
    <eyecolor>green</eyecolor>
    <job>Accountant</job>
    <year>1983</year>
  </cd>
  <cd>
    <person>Luciano Pavarotti</person>
    <eyecolor>blue</eyecolor>
    <job>Consultant</job>
    <year>1991</year>
  </cd>
  <cd>
    <person>Otis Redding</person>
    <eyecolor>brown</eyecolor>
    <job>Mechanic</job>
    <year>1968</year>
  </cd>
  <cd>
    <person>Mike Dean</person>
    <eyecolor>green</eyecolor>
    <job>Engineer</job>
    <year>1985</year>
  </cd>
</catalog>

ng with my codes?

1
  • Could you please add your current output and expected output? Commented May 18, 2022 at 13:36

1 Answer 1

1

Instead of:

  <td><xsl:value-of select=""/>@person</td>
  <td><xsl:value-of select=""/>@eyecolor</td>
  <td><xsl:value-of select=""/>@jobs</td>
  <td><xsl:value-of select=""/>@year</td>

do:

  <td><xsl:value-of select="person"/></td>
  <td><xsl:value-of select="eyecolor"/></td>
  <td><xsl:value-of select="job"/></td>
  <td><xsl:value-of select="year"/></td>
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks 4 the advice, but this didn't work either :((
"Didn't work" is not a useful description of a problem. You can see the adjusted code working here: xsltfiddle.liberty-development.net/93PXKqb (click the HTML button in the result pane to see the rendered result).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.