mirror of
https://gitlab.com/tutorial-java-rafa-munoz/tutorial-java-2024-25/LMSGI-2024-25.git
synced 2025-11-10 02:13:05 +01:00
feat(ch 6 & 7): added
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user