From:             [EMAIL PROTECTED]
Operating system: Windows 2000
PHP version:      4.3.0
PHP Bug Type:     XML related
Bug description:  casefolding option should be off by default

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 bug report at http://bugs.php.net/?id=22192&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22192&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22192&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22192&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22192&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22192&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22192&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22192&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22192&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22192&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22192&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22192&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22192&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22192&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22192&r=gnused

Reply via email to