|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25948 XSLT_SABOPT_DISABLE_ADDING_META - if false generates invalid XML
Submitted: 2003-10-22 06:10 UTC Modified: 2003-10-22 21:08 UTC
From: phpdocs at pointbeing dot net Assigned:
Status: Not a bug Package: XSLT related
PHP Version: 4.3.2 OS: Red Hat Linux release 7.3 (Valha
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: phpdocs at pointbeing dot net
New email:
PHP Version: OS:


 [2003-10-22 06:10 UTC] phpdocs at pointbeing dot net
The XSLT_SABOPT_DISABLE_ADDING_META constant, set during compilation, automatically adds:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

to the output when it detects that the output is likely to be HTML. Problem is not the fact that it adds it - but that this line isn't actually valid XML - thus breaking the validity of any output! 

Reproduce code:
Occurs whenever xslt_process() is used to generate HTML output.

Examples -

XSL File:

XML Source:

Expected result:
I would like to see valid XML generated, for example:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

Actual result:
This is output automatically:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

This apparently cannot be disabled at runtime.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-22 12:47 UTC] phpdocs at pointbeing dot net
I should add that this occurs when the constant is set to 'false'.
 [2003-10-22 21:08 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

PHP only sets options, the actual addition is performed by the Sablotron library. Hence the bug is in it, not PHP.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Apr 16 18:01:23 2021 UTC