ID:               22192
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Wont fix
 Bug Type:         XML related
 Operating System: all
 PHP Version:      4.3.0
 New Comment:

You can change it within your script with  xml_parser_set_option(), as
you most likely 
already know. But we can't change the default because
of backwards compatibility.




Previous Comments:
------------------------------------------------------------------------

[2003-02-12 17:13:18] [EMAIL PROTECTED]

changed 'OS' from 'Windows 2000' to 'all'

------------------------------------------------------------------------

[2003-02-12 17:04:33] [EMAIL PROTECTED]

The default setting for casefolding for element and attribute
names for standard PHP XML parsers (created with
xml_parser_create()) is set to ON (see
http://www.php.net/manual/en/ref.xml.php#xml.case-folding).
Unfortunately, this is in strong contrast with the XML
Standard, which specifies that all element and attribute
names are case-sensitive
(i.e. <foo> and <FOO> are two completely different things).

Having to call
xml_parser_set_option ($xml_parser, XML_OPTION_CASE_FOLDING, FALSE);
every time is tedious. Forgetting it results in faulty
code (even if it may look like it works). This is very
much against the quick and straightforward way that
programmers have come to love and expect of PHP.

The default for case-folding should therefore be changed,
so that it is off. Even better would be to completely
disable this option in the PHP glue interfacing with expat.
Case-folding of element and attribute names and XML simply
don't belong together.

Changing defaults may not be done easily, so planning for
this should start as early as possible.

As a first step, it would also be very helpful to improve
the documentation. The documentation should very clearly
say that using xml_parser_set_option() after xml_parser_create() is
necessary, and in all examples,
xml_parser_set_option() should actually be called.

Many thanks in advance for fixing this problem, and helping
with correct XML and easy PHP programming. Please contact
me if you need more information or have questions.

Regards,    Martin.


Some additional remarks:

The option is either a remnant of
SGML (the precursor of XML), or remained from the time
where "to case-fold or not to case-fold" was still under
consideration before XML got finalized (more than 5 years
ago).

Fortunately, the parser marks
"<foo>this is some text</FOO>" as illegal even if case-folding is set
on, so the case-folding option only
affects values passed to the callbacks. But that's
bad enough.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=22192&edit=1

Reply via email to