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

前端 未结 7 1678
暖寄归人
暖寄归人 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:54

    There was auto generated Copyright message in XML and a blank line before <resources> tag, once I removed it my build was successful.

    0 讨论(0)
  • 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 <?xml ?> declaration.

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

    2. Some invisible content exists before the <?xml ?> 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 <?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.

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

    0 讨论(0)
  • 2020-11-22 04:03

    in my case was a wrong path in a config file: file was not found (path was wrong) and it came out with this exception:

    Error configuring from input stream. Initial cause was The processing instruction target matching "[xX][mM][lL]" is not allowed.

    0 讨论(0)
  • 2020-11-22 04:08

    Another reason of the above error is corrupted jar file. I got the same error but for Junit when running unit tests. Removing jar and downloading it again fix the issue.

    0 讨论(0)
  • 2020-11-22 04:11

    For PHP, put this line of code before you start printing your XML:

    while(ob_get_level()) ob_end_clean();
    
    0 讨论(0)
  • 2020-11-22 04:14

    Reason for me is 2 of following code in one xml

    <?xml version="1.0" encoding="utf-8"?>
    
    0 讨论(0)
提交回复
热议问题