まともな XML エディターは、おそらく何が問題なのかを教えてくれるでしょう:
<table>
終了タグが必要な場所に開始タグがあります</table>
。
&eq;
標準 XML では意味がありません。あなたが使用する必要があります=
<xsl:choose>
select
属性を許可しません
- XPath をスラッシュで終了することは違法です。
そして論理エラー:
@observaciones = urgente
がノード(この場合は存在しない)@observaciones
と等しいかどうかをテストします。を使用する必要があります。 urgente
@observaciones = 'urgente'
これらが修正されたら、うまくいくと思います。修正版は次のとおりです。
<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="yes"/>
<xsl:template match="/empresa">
<html>
<head>
<title>
<xsl:value-of select="sede/nombre" />
</title>
<link rel="stylesheet" href="empresa.css" />
</head>
<body>
<table>
<tr class="titulo">
<td>
<p>
<xsl:value-of select="sede/nombre" />
</p>
</td>
<td rowspan="2">
<img alt="empresa" src="empresa.png" />
</td>
</tr>
<tr class="subtitulo">
<td>
<p>Albaran</p>
</td>
</tr>
<xsl:apply-templates select="pedido">
<xsl:sort select="@id" />
</xsl:apply-templates>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="pedido">
<tr class="cuerpo">
<td rowspan="3">
<span>
<xsl:value-of select="sucursal/nombre" />
</span>
<br />
<span>
<xsl:value-of select="sucursal/region" />
</span>
</td>
</tr>
<tr class="fecha">
<td>
<p>
Albaran con fecha de: <xsl:value-of select="fecha" />
</p>
</td>
</tr>
<tr class="npedido">
<xsl:apply-templates select="@id" />
</tr>
<tr class="articulos">
<td>
<table>
<tr>
<th>
<span>Cod. de articulo</span>
</th>
<th>
<span>N. de unidades</span>
</th>
<th>
<span>Precio por unidad</span>
</th>
<th>
<span>Observaciones</span>
</th>
</tr>
<xsl:apply-templates select="articulo">
<xsl:sort select="@id" />
</xsl:apply-templates>
</table>
</td>
</tr>
<tr class="observaciones">
<td>
<xsl:apply-templates select="@observaciones[. = 'urgente' or
. = 'incompleto']" />
</td>
</tr>
</xsl:template>
<xsl:template match="articulo">
<tr>
<xsl:apply-templates select="@id" />
<xsl:apply-templates select="@cant" />
<xsl:apply-templates select="@precioud" />
<xsl:call-template name="Cell">
<xsl:with-param name="value" select="@observaciones" />
</xsl:call-template>
</tr>
</xsl:template>
<xsl:template match="articulo/@* | pedido/@id"
name="Cell">
<xsl:param name="value" select="." />
<td>
<span>
<xsl:value-of select="$value" />
</span>
</td>
</xsl:template>
<xsl:template match="@observaciones">
<strong>
<xsl:value-of select="concat(translate(substring(., 1, 1), 'it', 'IT'),
substring(., 2))"/>
</strong>
</xsl:template>
</xsl:stylesheet>