feat(ch 6 & 7): added

This commit is contained in:
Rafa Muñoz
2025-04-07 12:01:02 +02:00
parent 2a060caea7
commit 38284b033d
169 changed files with 2651 additions and 1 deletions

View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="iso-8859-1"/>
<xsl:template match="/celebracion">
<html>
<head>
<title><xsl:value-of select="@name"/></title>
<xsl:call-template name="css"/>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="menu">
<h1>Platos</h1>
<xsl:for-each select="plato">
<xsl:sort select="." order="ascending"/>
<p style="font-weight: bolder">
<xsl:value-of select="."/>
</p>
</xsl:for-each>
</xsl:template>
<xsl:template match="espirituosas">
<h1>Espirituosas</h1>
<xsl:apply-templates select="bebida">
<xsl:sort select="@nombre" order="ascending"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="bebida">
<p style="font-weight: bolder">
<xsl:value-of select="@nombre"/>
</p>
</xsl:template>
<xsl:template name="css">
<style>
body{
background: red;
color: white;
}
</style>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="navidad.xsl" ?>
<celebracion name="Comida Navidad">
<menu>
<plato>Patatas bravas</plato>
<plato>Entrecot ternera 1ª</plato>
<plato>Danonino</plato>
</menu>
<espirituosas>
<bebida nombre="licor de hierbas"/>
<bebida nombre="Cocacola Zero"/>
<bebida nombre="Fanta naranja"/>
</espirituosas>
</celebracion>