错误:处理指令目标匹配“[xX][mM][lL]"不被允许 [英] Error: The processing instruction target matching "[xX][mM][lL]" is not allowed
问题描述
这个错误,
不允许匹配[xX][mM][lL]"的处理指令目标
The processing instruction target matching "[xX][mM][lL]" is not allowed
每当我运行以如下方式开头的 XSLT 页面时都会发生:
occurs whenever I run an XSLT page that begins as follows:
<?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>
注意:我把第一行前的所有前导空格都去掉了,但还是出现错误!
Note: I removed any leading spaces before the first line, but the error still occurs!
推荐答案
基于 Xerces 的工具将发出以下错误
The processing instruction target matching "[xX][mM][lL]" is not allowed.
当遇到 XML 声明时在其他任何地方而不是在 XML 文件的顶部.
这是一条有效的诊断消息;在这种情况下,其他 XML 解析器应该会发出类似的错误消息.
This is a valid diagnostic message; other XML parsers should issue a similar error message in this situation.
在
之前存在一些空格或其他可见内容声明.
Some blank space or other visible content exists before the
<?xml ?>
declaration.
解决方案:删除空格或任何其他XML 声明之前的可见内容.
Resolution: remove blank space or any other visible content before the XML declaration.
一些不可见内容存在于之前声明.最常见的是字节顺序标记(物料清单).
Some invisible content exists before the <?xml ?>
declaration. Most commonly this is a Byte Order Mark
(BOM).
分辨率:使用诸如 W3C 建议的技术删除 BOM以 HTML 格式显示在 BOM 上的页面.
XML 内容中存在杂散的 声明.当 XML 文件以编程方式组合或通过剪切和粘贴.只能有一个
声明在一个 XML 文件中,它只能在顶部.
A stray <?xml ?>
declaration exists within the XML content.
This can happen when XML files are combined programmatically or
via cut-and-paste. There can only be one <?xml ?>
declaration
in an XML file, and it can only be at the top.
分辨率:搜索<?xml
以不区分大小写的方式,并删除除顶部 XML 之外的所有内容文件中的声明.
Resolution: Search for
<?xml
in a case-insensitive manner, and remove all but the top XML
declaration from the file.
这篇关于错误:处理指令目标匹配“[xX][mM][lL]"不被允许的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!