mirror of
https://gitlab.com/tutorial-java-rafa-munoz/tutorial-java-2024-25/LMSGI-2024-25.git
synced 2025-11-09 18:03:06 +01:00
feat(ch 6 & 7): added
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<?xml-stylesheet type="text/xsl" href="xml-xsl-ejercicicio01.xsl" ?>
|
||||
|
||||
<superheroe>
|
||||
<nombre>Thor, el Dios</nombre>
|
||||
<poderes>Martillo mágico, Dios, Fuerza</poderes>
|
||||
<amigos>Iron Man y Hulk</amigos>
|
||||
</superheroe>
|
||||
26
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio01.xsl
Normal file
26
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio01.xsl
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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="/superheroe">
|
||||
<html>
|
||||
<head>
|
||||
<title>Superheroes de Marvel</title>
|
||||
</head>
|
||||
<body>
|
||||
<xsl:apply-templates/>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
<xsl:template match="nombre">
|
||||
<h1>Superheroe: <xsl:value-of select="."/></h1>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="poderes">
|
||||
<h1>Poderes: <xsl:value-of select="."/></h1>
|
||||
</xsl:template>
|
||||
<xsl:template match="amigos">
|
||||
<h1>Amigos: <xsl:value-of select="."/></h1>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="xml-xsl-ejercicicio02.xsl"?>
|
||||
|
||||
<superheroe>
|
||||
<nombre>Thor</nombre>
|
||||
<poderes>Martillo mágico, Dios, Fuerza
|
||||
<invulnerable>Sí</invulnerable>
|
||||
</poderes>
|
||||
<amigos>Iron Man y Hulk</amigos>
|
||||
</superheroe>
|
||||
45
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio02.xsl
Normal file
45
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio02.xsl
Normal file
@@ -0,0 +1,45 @@
|
||||
<?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="/superheroe">
|
||||
<html>
|
||||
<head>
|
||||
<title>Superheroes</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 50px;
|
||||
padding: 0px;
|
||||
background: #2372DE;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-size: 11pt;
|
||||
color: #FFFFFF;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.tituloTabla {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table border="1">
|
||||
<xsl:apply-templates />
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="nombre">
|
||||
<tr class="tituloTabla">
|
||||
<td><xsl:value-of select="."/></td>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="amigos">
|
||||
<tr class="tituloTabla">
|
||||
<td><xsl:value-of select="."/></td>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="xml-xsl-ejercicicio03.xsl"?>
|
||||
|
||||
<marvel>
|
||||
<superheroe>
|
||||
<nombre>Thor</nombre>
|
||||
<poderes>Martillo mágico, Dios, Fuerza</poderes>
|
||||
<amigos>Iron Man y Hulk</amigos>
|
||||
</superheroe>
|
||||
<superheroe>
|
||||
<nombre>Hulk</nombre>
|
||||
<poderes>Superfuerza, indestructible</poderes>
|
||||
<amigos>Iron Man y Thor</amigos>
|
||||
</superheroe>
|
||||
<superheroe>
|
||||
<nombre>Iron Man</nombre>
|
||||
<poderes>Armadura, intelecto superior</poderes>
|
||||
<amigos>Hulk y Thor</amigos>
|
||||
</superheroe>
|
||||
<supervillano>
|
||||
<nombre>Doctor Muerte</nombre>
|
||||
<poderes>Armadura, intelecto superior</poderes>
|
||||
<amigos>No tiene</amigos>
|
||||
</supervillano>
|
||||
</marvel>
|
||||
49
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio03.xsl
Normal file
49
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio03.xsl
Normal file
@@ -0,0 +1,49 @@
|
||||
<?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="/marvel">
|
||||
<html>
|
||||
<head>
|
||||
<title>Superheroes</title>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 50px;
|
||||
padding: 0px;
|
||||
background: #2372DE;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-size: 11pt;
|
||||
color: #FFFFFF;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.tituloTabla {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<xsl:apply-templates/>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="superheroe">
|
||||
<table border="1">
|
||||
<tr class="tituloTabla">
|
||||
<td><xsl:value-of select="nombre"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>poderes: <xsl:value-of select="poderes"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>amigos: <xsl:value-of select="amigos"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="xml-xsl-ejercicicio04.xsl"?>
|
||||
|
||||
<marvel>
|
||||
<superheroe>
|
||||
<nombre>Thor</nombre>
|
||||
<poderes>Martillo mágico, Dios, Fuerza</poderes>
|
||||
<amigos>Iron Man y Hulk</amigos>
|
||||
</superheroe>
|
||||
<superheroe>
|
||||
<nombre>Hulk</nombre>
|
||||
<poderes>Superfuerza, indestructible</poderes>
|
||||
<amigos>Iron Man y Thor</amigos>
|
||||
</superheroe>
|
||||
<superheroe>
|
||||
<nombre>Iron Man</nombre>
|
||||
<poderes>Armadura, intelecto superior</poderes>
|
||||
<amigos>Hulk y Thor</amigos>
|
||||
</superheroe>
|
||||
<supervillano>
|
||||
<nombre>Loki</nombre>
|
||||
<poderes>Mago</poderes>
|
||||
<amigos>Thor</amigos>
|
||||
</supervillano>
|
||||
</marvel>
|
||||
51
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio04.xsl
Normal file
51
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio04.xsl
Normal file
@@ -0,0 +1,51 @@
|
||||
<?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="/marvel">
|
||||
<html>
|
||||
<head>
|
||||
<title>Superheroes</title>
|
||||
<xsl:call-template name="css"/>
|
||||
</head>
|
||||
<body>
|
||||
<xsl:apply-templates select="superheroe"/>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="css">
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 50px;
|
||||
padding: 0px;
|
||||
background: #2372DE;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-size: 11pt;
|
||||
color: #FFFFFF;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.tituloTabla {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="superheroe">
|
||||
<table border="1">
|
||||
<tr class="tituloTabla">
|
||||
<td><xsl:value-of select="nombre"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>poderes: <xsl:value-of select="poderes"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>amigos: <xsl:value-of select="amigos"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="xml-xsl-ejercicicio05.xsl"?>
|
||||
|
||||
<marvel>
|
||||
<superheroe>
|
||||
<nombre>Thor</nombre>
|
||||
<poderes>Martillo mágico, Dios, Fuerza</poderes>
|
||||
<amigos>Iron Man y Hulk</amigos>
|
||||
</superheroe>
|
||||
<superheroe>
|
||||
<nombre>Hulk</nombre>
|
||||
<poderes>Superfuerza, indestructible</poderes>
|
||||
<amigos>Iron Man y Thor</amigos>
|
||||
</superheroe>
|
||||
<superheroe>
|
||||
<nombre>Iron Man</nombre>
|
||||
<poderes>Armadura, intelecto superior</poderes>
|
||||
<amigos>Hulk y Thor</amigos>
|
||||
</superheroe>
|
||||
<supervillano>
|
||||
<nombre>Dr Muerte</nombre>
|
||||
<poderes>Armadura, intelecto superior</poderes>
|
||||
<amigos>Hulk y Thor</amigos>
|
||||
</supervillano>
|
||||
</marvel>
|
||||
49
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio05.xsl
Normal file
49
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio05.xsl
Normal file
@@ -0,0 +1,49 @@
|
||||
<?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="/marvel">
|
||||
<html>
|
||||
<head>
|
||||
<title>Superheroes</title>
|
||||
<xsl:call-template name="css"/>
|
||||
</head>
|
||||
<body>
|
||||
<xsl:for-each select="superheroe">
|
||||
<table border="1">
|
||||
<tr class="tituloTabla">
|
||||
<td><xsl:value-of select="nombre"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>poderes: <xsl:value-of select="poderes"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>amigos: <xsl:value-of select="amigos"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
</xsl:for-each>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="css">
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 50px;
|
||||
padding: 0px;
|
||||
background: #2372DE;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-size: 11pt;
|
||||
color: #FFFFFF;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.tituloTabla {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="xml-xsl-ejercicicio06.xsl"?>
|
||||
|
||||
<marvel>
|
||||
<superheroe nombre="Thor" poderes="Martillo mágico, Dios, Fuerza" amigos="Iron Man y Hulk"/>
|
||||
<superheroe nombre="Hulk" poderes="Superfuerza, indestructible" amigos="Iron Man y Thor"/>
|
||||
<superheroe nombre="Iron Man" poderes="Armadura, intelecto superior" amigos="Hulk y Thor"/>
|
||||
</marvel>
|
||||
50
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio06.xsl
Normal file
50
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio06.xsl
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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="/marvel">
|
||||
<html>
|
||||
<head>
|
||||
<title>Superheroes</title>
|
||||
<xsl:call-template name="css"/>
|
||||
</head>
|
||||
<body>
|
||||
<xsl:for-each select="superheroe">
|
||||
<xsl:sort select="@nombre" order="ascending"/>
|
||||
<table border="1">
|
||||
<tr class="tituloTabla">
|
||||
<td><xsl:value-of select="@nombre"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>poderes: <xsl:value-of select="@poderes"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>amigos: <xsl:value-of select="@amigos"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
</xsl:for-each>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="css">
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 50px;
|
||||
padding: 0px;
|
||||
background: #2372DE;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-size: 11pt;
|
||||
color: #FFFFFF;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.tituloTabla {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="xml-xsl-ejercicicio07.xsl"?>
|
||||
|
||||
<marvel>
|
||||
<superheroe nombre="Thor" poderes="Martillo mágico, Dios, Fuerza" amigos="Iron Man y Hulk"/>
|
||||
<superheroe nombre="Hulk" poderes="Superfuerza, indestructible" amigos="Iron Man y Thor"/>
|
||||
<superheroe nombre="Iron Man" poderes="Armadura, intelecto superior" amigos="Hulk y Thor"/>
|
||||
</marvel>
|
||||
51
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio07.xsl
Normal file
51
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio07.xsl
Normal file
@@ -0,0 +1,51 @@
|
||||
<?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="/marvel">
|
||||
<html>
|
||||
<head>
|
||||
<title>Superheroes</title>
|
||||
<xsl:call-template name="css"/>
|
||||
</head>
|
||||
<body>
|
||||
<xsl:for-each select="superheroe">
|
||||
<xsl:if test="@nombre='Thor' or @nombre='Hulk'">
|
||||
<table border="1">
|
||||
<tr class="tituloTabla">
|
||||
<td><xsl:value-of select="@nombre"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>poderes: <xsl:value-of select="@poderes"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>amigos: <xsl:value-of select="@amigos"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</xsl:if>
|
||||
<br/>
|
||||
</xsl:for-each>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="css">
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 50px;
|
||||
padding: 0px;
|
||||
background: #2372DE;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-size: 11pt;
|
||||
color: #FFFFFF;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.tituloTabla {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="xml-xsl-ejercicicio08.xsl"?>
|
||||
|
||||
<marvel>
|
||||
<superheroe nombre="Thor" poderes="Martillo mágico, Dios, Fuerza" amigos="Iron Man y Hulk"/>
|
||||
<superheroe nombre="Hulk" poderes="Superfuerza, indestructible" amigos="Iron Man y Thor"/>
|
||||
<superheroe nombre="Iron Man" poderes="Armadura, intelecto superior" amigos="Hulk y Thor"/>
|
||||
</marvel>
|
||||
46
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio08.xsl
Normal file
46
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio08.xsl
Normal file
@@ -0,0 +1,46 @@
|
||||
<?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="/marvel">
|
||||
<html>
|
||||
<head>
|
||||
<title>Superheroes</title>
|
||||
<xsl:call-template name="css"/>
|
||||
</head>
|
||||
<body>
|
||||
<table border="1">
|
||||
<tr class="tituloTabla">
|
||||
<td>Thor</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>poderes: <xsl:value-of select="superheroe[@nombre='Thor']/@poderes"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>amigos: <xsl:value-of select="superheroe[@nombre='Thor']/@amigos"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="css">
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 50px;
|
||||
padding: 0px;
|
||||
background: #2372DE;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-size: 11pt;
|
||||
color: #FFFFFF;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.tituloTabla {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="xml-xsl-ejercicicio09.xsl"?>
|
||||
|
||||
<marvel>
|
||||
<superheroe nombre="Thor" poderes="Martillo mágico, Dios, Fuerza" amigos="Iron Man y Hulk"/>
|
||||
<superheroe nombre="Hulk" poderes="Superfuerza, indestructible" amigos="Iron Man y Thor"/>
|
||||
<superheroe nombre="Iron Man" poderes="Armadura, intelecto superior" amigos="Hulk y Thor"/>
|
||||
</marvel>
|
||||
89
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio09.xsl
Normal file
89
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio09.xsl
Normal file
@@ -0,0 +1,89 @@
|
||||
<?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="/marvel">
|
||||
<html>
|
||||
<head>
|
||||
<title>Superheroes</title>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Total de nodos de tipo superheroe -->
|
||||
<p>Total de superheroes: <xsl:value-of select="count(superheroe)"/></p>
|
||||
|
||||
<!-- Acceso a diferentes nodos de una colección (iguales y hermanos) a través de la posición que ocupan -->
|
||||
<p>Primer superheroe: <xsl:value-of select="superheroe[1]/@nombre"/></p>
|
||||
<p>Segundo superheroe: <xsl:value-of select="superheroe[2]/@nombre"/></p>
|
||||
<p>Tercer superheroe: <xsl:value-of select="superheroe[3]/@nombre"/></p>
|
||||
|
||||
<!-- Conseguir la posición que ocupa cada nodo en una colección -->
|
||||
<xsl:for-each select="superheroe">
|
||||
<p>Superheroe: <xsl:value-of select="@nombre"/>, posición: <xsl:value-of select="position()"/></p>
|
||||
</xsl:for-each>
|
||||
|
||||
<!-- Concatenación de cadenas de caracteres -->
|
||||
<p>Ejemplo de concatenación: <xsl:value-of select="concat('Vengador ', superheroe[1]/@nombre)"/></p>
|
||||
|
||||
<!-- Función para comprobar si una cadena de texto se encuentra dentro de otra -->
|
||||
<xsl:for-each select="superheroe">
|
||||
<xsl:if test="contains(@nombre, 'ho')">
|
||||
<p>Ejemplo de contains: <xsl:value-of select="@nombre"/></p>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
|
||||
<!-- Obtener la longitud de una cadena de caracteres -->
|
||||
<p>Ejemplo de string-length. Thor tiene <xsl:value-of select="string-length('Thor')"/> caracteres</p>
|
||||
|
||||
<!-- Subcadena de una cadena de texto -->
|
||||
<p>Ejemplo de substring: <xsl:value-of select="substring('Una cadena de texto', 2, 8)"/></p>
|
||||
|
||||
<!-- Ejemplo de operación combinada de suma, multiplicación y división entera -->
|
||||
<p>Ejemplo calculo matemático <xsl:value-of select="((4 + 8) div 2) * 2"/></p>
|
||||
|
||||
<!-- Resto de una división entera -->
|
||||
<p>Ejemplo de funcíon módulo o resto de la división <xsl:value-of select="15 mod 4"/></p>
|
||||
|
||||
<!-- Negación -->
|
||||
<xsl:if test="(not(false))">
|
||||
<p>Ejemplo de 'not'</p>
|
||||
</xsl:if>
|
||||
|
||||
<!-- Comparación "distinto de" -->
|
||||
<xsl:if test="12 != 10">
|
||||
<p>Ejemplo de '!='</p>
|
||||
</xsl:if>
|
||||
|
||||
<!-- Comparación "menor que" -->
|
||||
<xsl:if test="(5 < 10)">
|
||||
<p>Ejemplo de '<'</p>
|
||||
</xsl:if>
|
||||
|
||||
<!-- Comparación "mayor que" -->
|
||||
<xsl:if test="10 > 5">
|
||||
<p>Ejemplo de '>'</p>
|
||||
</xsl:if>
|
||||
|
||||
<!-- Comparación "menor o igual que" -->
|
||||
<xsl:if test="6 <= 6">
|
||||
<p>Ejemplo de '<='</p>
|
||||
</xsl:if>
|
||||
|
||||
<!-- Comparación "mayor o igual que" -->
|
||||
<xsl:if test="6 >= 6">
|
||||
<p>Ejemplo de '>='</p>
|
||||
</xsl:if>
|
||||
|
||||
<!-- Operador de disyunción or -->
|
||||
<xsl:if test="(1 > 2) or (2 > 1)">
|
||||
<p>Ejemplo de 'or'</p>
|
||||
</xsl:if>
|
||||
|
||||
<!-- Operador and -->
|
||||
<xsl:if test="(1 >= 1) and (2 != 4)">
|
||||
<p>Ejemplo de 'and'</p>
|
||||
</xsl:if>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="xml-xsl-ejercicicio10.xsl"?>
|
||||
|
||||
<marvel>
|
||||
<superheroe nombre="Thor" poderes="Martillo mágico, Dios, Fuerza" amigos="Iron Man y Hulk" nivel="7"/>
|
||||
<superheroe nombre="Gamora" poderes="Superfuerza, indestructible" amigos="Iron Man y Thor" nivel="8"/>
|
||||
<superheroe nombre="Iron Man" poderes="Armadura, intelecto superior" amigos="Hulk y Thor" nivel="6"/>
|
||||
<superheroe nombre="Capitán América" poderes="fuerza, resistencia, superguerrero" amigos="Iron Man" nivel="5"/>
|
||||
<superheroe nombre="Viuda Negra" poderes="coordinación, luchadora" amigos="No tiene" nivel="6"/>
|
||||
<superheroe nombre="Bruja escarlata" poderes="coordinación, luchadora" amigos="No tiene" nivel="6"/>
|
||||
</marvel>
|
||||
66
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio10.xsl
Normal file
66
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio10.xsl
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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="/marvel">
|
||||
<html>
|
||||
<head>
|
||||
<title>Superheroes</title>
|
||||
<xsl:call-template name="css"/>
|
||||
</head>
|
||||
<body>
|
||||
<xsl:for-each select="superheroe">
|
||||
<table border="1">
|
||||
<tr class="tituloTabla">
|
||||
<td><xsl:value-of select="@nombre"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>poderes: <xsl:value-of select="@poderes"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>amigos: <xsl:value-of select="@amigos"/></td>
|
||||
</tr>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@nivel > 7">
|
||||
<tr>
|
||||
<td>Este superheroe es muy poderoso</td>
|
||||
</tr>
|
||||
</xsl:when>
|
||||
<xsl:when test="@nivel < 6">
|
||||
<tr>
|
||||
<td>Este superheroe es muy malo</td>
|
||||
</tr>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<tr>
|
||||
<td>Este superheroe es normalito</td>
|
||||
</tr>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</table>
|
||||
<br/>
|
||||
</xsl:for-each>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="css">
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 50px;
|
||||
padding: 0px;
|
||||
background: #2372DE;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-size: 11pt;
|
||||
color: #FFFFFF;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.tituloTabla {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="xml-xsl-ejercicicio11.xsl"?>
|
||||
|
||||
<marvel>
|
||||
<superheroe nombre="Thor" poderes="Martillo mágico, Dios, Fuerza" amigos="Iron Man y Hulk" nivel="7"/>
|
||||
<superheroe nombre="Hulk" poderes="Superfuerza, indestructible" amigos="Iron Man y Thor" nivel="8"/>
|
||||
<superheroe nombre="Iron Man" poderes="Armadura, intelecto superior" amigos="Hulk y Thor" nivel="6"/>
|
||||
<superheroe nombre="Capitán América" poderes="fuerza, resistencia, superguerrero" amigos="Iron Man" nivel="6"/>
|
||||
<superheroe nombre="Viuda Negra" poderes="coordinación, luchadora" amigos="No tiene" nivel="6"/>
|
||||
<superheroe nombre="Nick Furia" poderes="coordinación, luchadora" amigos="No tiene" nivel="6"/>
|
||||
</marvel>
|
||||
52
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio11.xsl
Normal file
52
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio11.xsl
Normal file
@@ -0,0 +1,52 @@
|
||||
<?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="/marvel">
|
||||
<html>
|
||||
<head>
|
||||
<title>Superheroes</title>
|
||||
<xsl:call-template name="css"/>
|
||||
</head>
|
||||
<body>
|
||||
<xsl:for-each select="superheroe">
|
||||
<table border="1">
|
||||
<xsl:choose>
|
||||
<xsl:when test="(position() mod 2) = 1">
|
||||
<tr>
|
||||
<td style="background: #00FF00;"><xsl:value-of select="concat(@nombre, ' ', @poderes)"/></td>
|
||||
</tr>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<tr>
|
||||
<td><xsl:value-of select="concat(@nombre, ' ', @poderes)"/></td>
|
||||
</tr>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</table>
|
||||
<br/>
|
||||
</xsl:for-each>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="css">
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 50px;
|
||||
padding: 0px;
|
||||
background: #2372DE;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-size: 11pt;
|
||||
color: #FFFFFF;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.tituloTabla {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="xml-xsl-ejercicicio12.xsl"?>
|
||||
|
||||
<marvel>
|
||||
<superheroe nombre="Thor" imagen="https://static1.ara.cat/clip/bb9a1c21-ce80-4b48-b293-c91f8c37534e_16-9-aspect-ratio_default_0.jpg" color="#FF0000" poderes="Martillo mágico, Dios, Fuerza" amigos="Iron Man y Hulk" nivel="7"/>
|
||||
<superheroe nombre="Hulk" imagen="https://upload.wikimedia.org/wikipedia/commons/a/a0/Hulk_%282540708438%29.jpg" color="#00FF00" poderes="Superfuerza, indestructible" amigos="Iron Man y Thor" nivel="8"/>
|
||||
<superheroe nombre="Iron Man" color="#aba54d" poderes="Armadura, intelecto superior" amigos="Hulk y Thor" nivel="6"/>
|
||||
<superheroe nombre="Capitán América" color="#0000FF" poderes="fuerza, resistencia, superguerrero" amigos="Iron Man" nivel="6"/>
|
||||
<superheroe nombre="Viuda Negra" color="#000000" poderes="coordinación, luchadora" amigos="No tiene" nivel="6"/>
|
||||
<superheroe nombre="Nick Furia" color="#FFFFFF" poderes="coordinación, luchadora" amigos="No tiene" nivel="6"/>
|
||||
</marvel>
|
||||
67
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio12.xsl
Normal file
67
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio12.xsl
Normal file
@@ -0,0 +1,67 @@
|
||||
<?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="/marvel">
|
||||
<html>
|
||||
<head>
|
||||
<title>Superheroes</title>
|
||||
<xsl:call-template name="css"/>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Superhéroes de Marvel</h1>
|
||||
<xsl:for-each select="superheroe">
|
||||
<xsl:call-template name="tablaSuperheroe">
|
||||
<xsl:with-param name="numeroFila" select="position()"/>
|
||||
<xsl:with-param name="color" select="@color"/>
|
||||
<xsl:with-param name="imagen" select="@imagen"/>
|
||||
</xsl:call-template>
|
||||
</xsl:for-each>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="tablaSuperheroe">
|
||||
<xsl:param name="numeroFila"/>
|
||||
<xsl:param name="color"/>
|
||||
<xsl:param name="imagen"/>
|
||||
<table border="1">
|
||||
<tr>
|
||||
<td style="background: {$color}" >Esto es una tabla con posicion: <xsl:value-of select="$numeroFila"/></td>
|
||||
<td><img width="300px">
|
||||
<xsl:attribute name="src"><xsl:value-of select="$imagen"/></xsl:attribute>
|
||||
</img></td>
|
||||
</tr>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<xsl:template name="css">
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 50px;
|
||||
padding: 0px;
|
||||
background: #2372DE;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-size: 11pt;
|
||||
color: #FFFFFF;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.tituloTabla {
|
||||
text-align:center;
|
||||
padding:15px;
|
||||
background-color:#330099;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
</style>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="xml-xsl-ejercicicio13.xsl"?>
|
||||
|
||||
<marvel>
|
||||
<superheroe nombre="Thor" poderes="Martillo mágico, Dios, Fuerza" amigos="Iron Man y Hulk" nivel="7"/>
|
||||
<superheroe nombre="Hulk" poderes="Superfuerza, indestructible" amigos="Iron Man y Thor" nivel="8"/>
|
||||
<superheroe nombre="Iron Man" poderes="Armadura, intelecto superior" amigos="Hulk y Thor" nivel="6"/>
|
||||
<superheroe nombre="Capitán América" poderes="fuerza, resistencia, superguerrero" amigos="Iron Man" nivel="6"/>
|
||||
<superheroe nombre="Viuda Negra" poderes="coordinación, luchadora" amigos="No tiene" nivel="6"/>
|
||||
<superheroe nombre="Nick Furia" poderes="coordinación, luchadora" amigos="No tiene" nivel="6"/>
|
||||
</marvel>
|
||||
58
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio13.xsl
Normal file
58
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio13.xsl
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
|
||||
<xsl:output method="html" encoding="iso-8859-1"/>
|
||||
<xsl:template match="/marvel">
|
||||
<html>
|
||||
<head>
|
||||
<title>Superheroes</title>
|
||||
<xsl:call-template name="css"/>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Superhéroes de Marvel</h1>
|
||||
<xsl:call-template name="bucleForClasico">
|
||||
<xsl:with-param name="i">0</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="bucleForClasico">
|
||||
<xsl:param name="i"/>
|
||||
<xsl:if test="$i < 10">
|
||||
<p><xsl:value-of select="$i"/></p>
|
||||
<xsl:call-template name="bucleForClasico">
|
||||
<xsl:with-param name="i"><xsl:value-of select="$i + 1"/></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="css">
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 50px;
|
||||
padding: 0px;
|
||||
background: #2372DE;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-size: 11pt;
|
||||
color: #FFFFFF;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.tituloTabla {
|
||||
text-align:center;
|
||||
padding:15px;
|
||||
background-color:#330099;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
</style>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
56
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio13.xsl.html
Normal file
56
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio13.xsl.html
Normal file
@@ -0,0 +1,56 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Superheroes
|
||||
|
||||
|
||||
|
||||
Superhéroes de Marvel
|
||||
|
||||
0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
body {
|
||||
margin: 50px;
|
||||
padding: 0px;
|
||||
background: #2372DE;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-size: 11pt;
|
||||
color: #FFFFFF;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.tituloTabla {
|
||||
text-align:center;
|
||||
padding:15px;
|
||||
background-color:#330099;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="xml-xsl-ejercicicio14.xsl"?>
|
||||
|
||||
<marvel>
|
||||
<superheroe nombre="Thor" x="1" y="1"/>
|
||||
<superheroe nombre="Hulk" x="3" y="1"/>
|
||||
<superheroe nombre="Iron Man" x="1" y="2"/>
|
||||
<superheroe nombre="Capitán América" x="2" y="2"/>
|
||||
<superheroe nombre="Viuda Negra" x="1" y="3"/>
|
||||
<superheroe nombre="Nick Furia" x="3" y="3"/>
|
||||
</marvel>
|
||||
99
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio14.xsl
Normal file
99
Unidad_06_XSL/Tutorial/xml-xsl-ejercicicio14.xsl
Normal file
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
|
||||
<xsl:output method="html" encoding="iso-8859-1"/>
|
||||
<xsl:template match="/marvel">
|
||||
<html>
|
||||
<head>
|
||||
<title>Superheroes</title>
|
||||
<xsl:call-template name="css"/>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Superhéroes de Marvel</h1>
|
||||
<table border="1" with="90%">
|
||||
<xsl:call-template name="bucleForFila">
|
||||
<xsl:with-param name="i">1</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
|
||||
<xsl:template name="bucleForFila">
|
||||
<xsl:param name="i"/>
|
||||
<xsl:if test="$i <= 11">
|
||||
<tr>
|
||||
<xsl:call-template name="bucleForColumna">
|
||||
<xsl:with-param name="i"><xsl:value-of select="$i"/></xsl:with-param>
|
||||
<xsl:with-param name="j">1</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</tr>
|
||||
<xsl:call-template name="bucleForFila">
|
||||
<xsl:with-param name="i"><xsl:value-of select="$i + 1"/></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="bucleForColumna">
|
||||
<xsl:param name="i"/>
|
||||
<xsl:param name="j"/>
|
||||
<xsl:if test="$j <= 8">
|
||||
<xsl:call-template name="celda">
|
||||
<xsl:with-param name="x"><xsl:value-of select="$j"/></xsl:with-param>
|
||||
<xsl:with-param name="y"><xsl:value-of select="$i"/></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="bucleForColumna">
|
||||
<xsl:with-param name="i"><xsl:value-of select="$i"/></xsl:with-param>
|
||||
<xsl:with-param name="j"><xsl:value-of select="$j + 1"/></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="celda">
|
||||
<xsl:param name="x"/>
|
||||
<xsl:param name="y"/>
|
||||
<td>
|
||||
<xsl:for-each select="/marvel/superheroe">
|
||||
<xsl:if test="@x = $x and @y = $y">
|
||||
<xsl:value-of select="@nombre"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</td>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<xsl:template name="css">
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 50px;
|
||||
padding: 0px;
|
||||
background: #2372DE;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-size: 11pt;
|
||||
color: #FFFFFF;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.tituloTabla {
|
||||
text-align:center;
|
||||
padding:15px;
|
||||
background-color:#330099;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
</style>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet type="text/xsl" href="xml-xslfo-ejercicio15.xsl"?>
|
||||
|
||||
<marvel>
|
||||
<superheroe nombre="Thor" poderes="Martillo mágico, Dios, Fuerza" amigos="Iron Man y Hulk" nivel="7"/>
|
||||
<superheroe nombre="Hulk" poderes="Superfuerza, indestructible" amigos="Iron Man y Thor" nivel="8"/>
|
||||
<superheroe nombre="Iron Man" poderes="Armadura, intelecto superior" amigos="Hulk y Thor" nivel="6"/>
|
||||
<superheroe nombre="Capitán América" poderes="fuerza, resistencia, superguerrero" amigos="Iron Man" nivel="6"/>
|
||||
<superheroe nombre="Viuda Negra" poderes="coordinación, luchadora" amigos="No tiene" nivel="6"/>
|
||||
<superheroe nombre="Nick Furia" poderes="coordinación, luchadora" amigos="No tiene" nivel="6"/>
|
||||
</marvel>
|
||||
52
Unidad_06_XSL/Tutorial/xml-xslfo-ejercicio15.xsl
Normal file
52
Unidad_06_XSL/Tutorial/xml-xslfo-ejercicio15.xsl
Normal file
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0"
|
||||
xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<xsl:output method="xml" encoding="iso-8859-1" indent="yes"/>
|
||||
|
||||
<xsl:template match="/marvel">
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="A4" page-width="210mm" page-height="297mm" margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm">
|
||||
<fo:region-body margin="1cm"/>
|
||||
<fo:region-before extent="1cm"/>
|
||||
<fo:region-after extent="1cm"/>
|
||||
<fo:region-start extent="1cm"/>
|
||||
<fo:region-end extent="1cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
<fo:page-sequence master-reference="A4">
|
||||
<fo:title>Don Quijote de la Mancha</fo:title>
|
||||
<fo:static-content flow-name="xsl-region-before">
|
||||
<fo:block font-family="Arial" font-size="9pt" text-align="right" text-decoration="underline">Marvel - Superhéroes</fo:block>
|
||||
</fo:static-content>
|
||||
<fo:static-content flow-name="xsl-region-after">
|
||||
<fo:block font-family="Arial" font-size="9pt" text-align="center" text-decoration="underline">Ediciones Rafa Muñoz</fo:block>
|
||||
</fo:static-content>
|
||||
<fo:static-content flow-name="xsl-region-start">
|
||||
<fo:block-container reference-orientation="90">
|
||||
<fo:block font-family="Arial" font-size="9pt" text-align="center">Margen izquierdo</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:static-content>
|
||||
<fo:static-content flow-name="xsl-region-end">
|
||||
<fo:block-container reference-orientation="270">
|
||||
<fo:block font-family="Arial" font-size="9pt" text-align="center">Margen derecho</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:static-content>
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<fo:block-container font-family="Arial" font-size="10pt" line-height="1.5" text-align="justify" text-indent="1cm" id="Referencia-interna">
|
||||
<xsl:for-each select="superheroe">
|
||||
<fo:block >
|
||||
<fo:inline color="blue" font-size="16pt" font-weight="bold"><xsl:value-of select="@nombre"/></fo:inline>
|
||||
</fo:block>
|
||||
</xsl:for-each>
|
||||
</fo:block-container>
|
||||
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
101
Unidad_06_XSL/Tutorial/xml-xslfo-recopilatorio.fo
Normal file
101
Unidad_06_XSL/Tutorial/xml-xslfo-recopilatorio.fo
Normal file
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master master-name="A4" page-width="210mm" page-height="297mm" margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm">
|
||||
<fo:region-body margin="1cm"/>
|
||||
<fo:region-before extent="1cm"/>
|
||||
<fo:region-after extent="1cm"/>
|
||||
<fo:region-start extent="1cm"/>
|
||||
<fo:region-end extent="1cm"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
<fo:page-sequence master-reference="A4">
|
||||
<fo:title>Don Quijote de la Mancha</fo:title>
|
||||
<fo:static-content flow-name="xsl-region-before">
|
||||
<fo:block font-family="Arial" font-size="9pt" text-align="right" text-decoration="underline">Don Quijote de la Mancha</fo:block>
|
||||
</fo:static-content>
|
||||
<fo:static-content flow-name="xsl-region-after">
|
||||
<fo:block font-family="Arial" font-size="9pt" text-align="center" text-decoration="underline">Ediciones Rafa Muñoz</fo:block>
|
||||
</fo:static-content>
|
||||
<fo:static-content flow-name="xsl-region-start">
|
||||
<fo:block-container reference-orientation="90">
|
||||
<fo:block font-family="Arial" font-size="9pt" text-align="center">Margen izquierdo</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:static-content>
|
||||
<fo:static-content flow-name="xsl-region-end">
|
||||
<fo:block-container reference-orientation="270">
|
||||
<fo:block font-family="Arial" font-size="9pt" text-align="center">Margen derecho</fo:block>
|
||||
</fo:block-container>
|
||||
</fo:static-content>
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<fo:block-container font-family="Arial" font-size="10pt" line-height="1.5" text-align="justify" text-indent="1cm" id="Referencia-interna">
|
||||
<fo:block >
|
||||
<fo:inline color="blue" font-size="16pt" font-weight="bold">En</fo:inline> un lugar de la Mancha, de cuyo nombre no quiero acordarme, no ha mucho tiempo que vivía un hidalgo de los de lanza en astillero,
|
||||
adarga antigua, rocín flaco y galgo corredor. Una olla de algo más vaca que carnero, salpicón las más noches, duelos y quebrantos los sábados,
|
||||
lentejas los viernes, algún palomino de añadidura los domingos, consumían las tres partes de su hacienda. El resto della concluían sayo de
|
||||
velarte, calzas de velludo para las fiestas con sus pantuflos de lo mismo, los días de entre semana se honraba con su vellori de lo más fino.
|
||||
Tenía en su casa una ama que pasaba de los cuarenta, y una sobrina que no llegaba a los veinte, y un mozo de campo y plaza, que así ensillaba
|
||||
el rocín como tomaba la podadera. Frisaba la edad de nuestro hidalgo con los cincuenta años, era de complexión recia, seco de carnes, enjuto de
|
||||
rostro; gran madrugador y amigo de la caza. Quieren decir que tenía el sobrenombre de Quijada o Quesada (que en esto hay alguna diferencia en los
|
||||
autores que deste caso escriben), aunque por conjeturas verosímiles se deja entender que se llama Quijana; pero esto importa poco a nuestro cuento;
|
||||
basta que en la narración dél no se salga un punto de la verdad.
|
||||
</fo:block>
|
||||
</fo:block-container>
|
||||
|
||||
<fo:block><fo:leader /></fo:block>
|
||||
<fo:block><fo:leader /></fo:block>
|
||||
|
||||
<fo:block text-align="center">Ejemplo de tabla</fo:block>
|
||||
|
||||
<fo:block><fo:leader /></fo:block>
|
||||
|
||||
<fo:table border-left-width="2mm" width="100%" border-collapse="separate">
|
||||
<fo:table-column/>
|
||||
<fo:table-column/>
|
||||
|
||||
<fo:table-header>
|
||||
<fo:table-cell>
|
||||
<fo:block>Título de Columna 1</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block>Título de Columna 2</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-header>
|
||||
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell>
|
||||
<fo:block>Celda 1 - 1</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block>Celda 1 - 2</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row>
|
||||
<fo:table-cell>
|
||||
<fo:block>Celda 2 - 1</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block>Celda 2 - 2</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
|
||||
<fo:block><fo:leader /></fo:block>
|
||||
|
||||
<fo:block>
|
||||
Ejemplo de enlace interno: <fo:basic-link internal-destination="Referencia-interna" text-decoration="underline" color="blue">clic para ir al principio del documento</fo:basic-link>
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
Ejemplo de enlace externo: <fo:basic-link external-destination="url(http://www.google.es)" text-decoration="underline" color="blue">clic a google</fo:basic-link>
|
||||
</fo:block>
|
||||
|
||||
<fo:block><fo:leader /></fo:block>
|
||||
|
||||
<fo:block text-align="center">Ejemplo de imagen</fo:block>
|
||||
<fo:block text-align="center"><fo:external-graphic src="url(../image/marvel.jpg)" content-height="90%" scaling="uniform"/></fo:block>
|
||||
</fo:flow>
|
||||
</fo:page-sequence>
|
||||
</fo:root>
|
||||
BIN
Unidad_06_XSL/Tutorial/xml-xslfo-recopilatorio.pdf
Normal file
BIN
Unidad_06_XSL/Tutorial/xml-xslfo-recopilatorio.pdf
Normal file
Binary file not shown.
Reference in New Issue
Block a user