Processing Instruction Target Not Allowed: Resolved
The error "The processing instruction target matching 'xX[lL]' is not allowed" occurs in XSLT pages when the XML declaration is not placed at the very beginning of the file, preceding any other content.
Cause:
Xerces-based tools, including XSLT processors, produce this error when they encounter an XML declaration after encountering other content within the document. This includes:
Solution:
To resolve this error, check for the following:
1. Visible Content:
Ensure there are no blank spaces or other visible content before the "" declaration. If any exist, remove them.
2. Invisible Content:
Use techniques recommended by the W3C (e.g., an XML parser or text editor) to identify and remove BOMs from the XML file.
3. Stray XML Declarations:
Search for "
Example:
In the provided XSLT page, the error occurs because the "" declaration is not placed before all other content:
By moving the XML declaration to the very beginning of the page, the error should be resolved:
The above is the detailed content of How to Fix the 'Processing Instruction Target Not Allowed' Error in XSLT?. For more information, please follow other related articles on the PHP Chinese website!