【发布时间】:2013-11-22 05:43:01
【问题描述】:
这个错误,
不允许匹配“[xX][mM][lL]”的处理指令目标
每当我运行如下开头的 XSLT 页面时都会发生:
<?xml version="1.0" encoding="windows-1256"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include href="../header.xsl"/>
<xsl:template match="/">
<xsl:call-template name="pstyle"/>
<xsl:call-template name="Validation"/>
<xsl:variable name="strLang">
<xsl:value-of select="//lang"/>
</xsl:variable>
<!-- ////////////// Page Title ///////////// -->
<title>
<xsl:value-of select="//ListStudentFinishedExam.Title"/>
</title>
注意:我删除了第一行之前的所有前导空格,但错误仍然存在!
【问题讨论】:
-
这个错误不是 XSLT 特有的;它通常与 XML 解析有关。 不仅要检查您的主 XSLT 文件,还要检查任何包含/导入的 XSLT 文件 (
../header.xsl) 以及正在转换的 XML 输入文档,for each of the three possibilities I list in my answer below. -
根据我的经验,文件开头意外添加了一个新的空行。删除后它工作正常。所以我同意第一条评论。