XSLT con Saxon
Revisión del 19:54 28 feb 2023 de Joselv (discusión | contribuciones) (Página creada con « = Instalación = sudo apt-get install default-jdk sudo apt-get install libsaxonb-java libsaxon-java = Exemplo con XSLT = </syntaxhighlight lang=xml> <?xml version="1.0…»)
Instalación
sudo apt-get install default-jdk sudo apt-get install libsaxonb-java libsaxon-java
Exemplo con XSLT
</syntaxhighlight lang=xml> <?xml version="1.0" encoding="UTF-8"?> <catalog>
<cd>
<title>CD Title</title>
<artist>The artist</artist>
<company>Da Company</company>
<price>10000</price>
<year>1760</year>
</cd>
</catalog> </syntaxhighlight>
</syntaxhighlight lang=xslt> <?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> <body>
The Super title
| Title | artist |
|---|---|
| <xsl:value-of select="catalog/cd/title"/> | <xsl:value-of select="catalog/cd/artist"/> |
</body> </html>
</xsl:template> </xsl:stylesheet> </syntaxhighlight>
$ saxonb-xslt -xsl:xsl.xsl xml.xml
Warning: at xsl:stylesheet on line 2 column 80 of xsl.xsl:
Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor
<html>
<body>
<h2>The Super title</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>artist</th>
</tr>
<tr>
<td>CD Title</td>
<td>The artist</td>
</tr>
</table>
</body>
</html>