错误:处理指令目标匹配“[xX] [mM] [lL]”不被允许 [英] Error: The processing instruction target matching "[xX][mM][lL]" is not allowed

查看:305
本文介绍了错误:处理指令目标匹配“[xX] [mM] [lL]”不被允许的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我运行一个以如下开头的XSLT页面时,就会出现标题中的错误:

The error in the title 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.

/#NT-XMLDeclrel =noreferrer> XML声明

这是一个有效的诊断信息;在这种情况下,其他XML解析器应该发出类似的错误消息。

This is a valid diagnostic message; other XML parsers should issue a similar error message in this situation.


  1. <?xml?> 可见内容$ c>
    声明。

解决方案:删除空格或任何其他
可见内容XML声明。

Resolution: remove blank space or any other visible content before the XML declaration.

<?xml?>之前存在一些 不可见的内容;
声明。
最常见的是字节顺序标记
(BOM)

Some invisible content exists before the <?xml ?> declaration. Most commonly this is a Byte Order Mark (BOM).

分辨率
使用建议的技术删除BOM通过HTML上的 W3C
页面。

迷路<?xml?> 声明存在于XML内容中。
这可能发生在XML文件以编程方式组合或
通过cut-and-糊。 $ b在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆