0

I am having problems applying xsl:choose in my xslt document, trying to transform xml to html. The xml document looks like this (it's german)

and so on... now, in my html document I created a table that shows the moviename (Filmtitel) and then the title of the review (Reviewtitel) - with that I want, that in the background color of the table, where the review title is, you can see how good or how bad a person rated this movie. Therefore - if it's rated "good" - points 7-10 out of ten, the backgroundcolor will be green, if it's rated average 4-7 points out of ten the backgroundcolor will be yellow and if someone didn't enjoy this movie and rated it with 1-3 out of 10 points the backgroundcolor of the review title will be red.

I am afraid that i cannot make this work because I want to relate the element "Reviewtitel" with the element "Bewertung" to both show in the same table space - Reviewtitel shows the words that belong to that element but with the backgroundcolor I relate to it with xsl:choose out of the element Bewertung.

This is my xslt document so far

Any suggestions?

I am really a bloody beginner to xslt and stuff but whenever i tried to make it work, the table input with the name of the review disappeared completely.

Getz
  • 3,983
  • 6
  • 35
  • 52
Hanna
  • 1
  • 2
    For a start, don't link to images of your code samples, instead include them in the question properly formatted. – Martin Honnen Aug 24 '20 at 09:12
  • Please read this https://stackoverflow.com/help/how-to-ask and this https://meta.stackexchange.com/questions/22186/how-do-i-format-my-code-blocks – ceving Aug 24 '20 at 11:07
  • Your XSLT image does not look like XSLT. Looks more like XML. – ceving Aug 24 '20 at 11:10
  • 1
    The XML and XSLT links seem to be the wrong way around, and the XSLT sample doesn't include an xsl:choose so it's hard to see what you're doing wrong. (It's generally best to show us an attempt that doesn't work, rather than just asking "how do I do X", because it's then easier to see where your problems are.) – Michael Kay Aug 24 '20 at 11:10

0 Answers0