Error: The processing instruction target matching “[xX][mM][lL]” is not allowed

前端 未结 7 1827
暖寄归人
暖寄归人 2020-11-22 03:24

This error,

The processing instruction target matching \"[xX][mM][lL]\" is not allowed

occurs whenever I run an XSLT page that b

7条回答
  •  南旧
    南旧 (楼主)
    2020-11-22 03:57

    Xerces-based tools will emit the following error

    The processing instruction target matching "[xX][mM][lL]" is not allowed.
    

    when an XML declaration is encountered anywhere other than at the top of an XML file.

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

    To correct the problem, check the following possibilities:

    1. Some blank space or other visible content exists before the declaration.

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

    2. Some invisible content exists before the declaration. Most commonly this is a Byte Order Mark (BOM).

      Resolution: Remove the BOM using techniques such as those suggested by the W3C page on the BOM in HTML.

    3. A stray 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 declaration in an XML file, and it can only be at the top.

      Resolution: Search for in a case-insensitive manner, and remove all but the top XML declaration from the file.

提交回复
热议问题