Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Fig.6
Fig. 7
1.
Solucion:
No cierra la etiqueta canciones
Utiliza caracteres inválidos
2.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" ident="yes"/>
<xsl:template match="/">
<recopilatorio ref="COMP001">
<titulo>Exitos de siempre</titulo>
<año>2002</año>
<tracks>
<xsl:for-each
select="discografica/cd/canciones/cancion[duracion > 3]">
<track>
<xsl:attribute name="org_number">
<xsl:value-of select="@num"/>
</xsl:attribute>
<nombre><xsl:value-of select="titulo"/></nombre>
<duracion><xsl:value-of select="duracion"/></duracion>
</track>
</xsl:for-each>
</tracks>
</recopilatorio>
</xsl:template>
</xsl:stylesheet>
3.
var txt = '{ "-ref": "COMP001", "titulo": "Exitos de siempre ", "año": "2002",
"track": [ { "-org_number": "01", "nombre": "Yellow submarine", "duracion": "3.5"
}, { "-org_number": "02", "nombre": "Its my life", "duracion": "3.4" } ] }'
{
"-ref": "COMP001",
"titulo": "Exitos de siempre ",
"año": "2002",
"track": [
{
"-org_number": "01",
"titulo": "Yellow submarine",
"duracion": "3.5"
},
{
"-org_number": "02",
"titulo": "It's my life",
"duracion": "3.4"
}
]
}
4.
var obj = JSON.parse(txt);
/*Recorrer la matriz*/
for (i in canciones){
x += "<tr>";
x += "<td>" + canciones[i].nombre + "</td>";
x += "<td>" + canciones[i].duracion + "</td>";
x += "</tr>"
}
document.getElementById("ejercicio3").innerHTML = x;