1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <head> <meta charset="utf-8" /> <title>food List</title> </head> <body> <h3>Food list price < 20</h3> <xsl:for-each select="foodlist/food"> <xsl:if test="price < 0"> Name: <xsl:value-of select="name" />, Affix: <xsl:for-each select="affix"><xsl:value-of select="text()" /> </xsl:for-each>, Country: <xsl:value-of select="country" />, price: <xsl:value-of select="price" /> <br /><br /> </xsl:if> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet>
|