From:             [EMAIL PROTECTED]
Operating system: Solaris 2.8
PHP version:      4.2.3
PHP Bug Type:     XML related
Bug description:  xml_parse_into_struct does not follow XML 1.0 specs w.r.t. default 
attributes

XML 1.0 specs say that default attribute values will be parsed as if those
attributes were directly specified:

>From the XML 1.0 Spec
(http://www.w3.org/TR/2000/REC-xml-20001006#attdecls)

"[Definition: If the declaration is neither #REQUIRED nor #IMPLIED, then
the AttValue value contains the declared default value; the #FIXED keyword
states that the attribute must always have the default value. If a default
value is declared, when an XML processor encounters an omitted attribute,
it is to behave as though the attribute were present with the declared
default value.]"

I have the following DTD:

<!ELEMENT J ...>
<!ATTLIST J att #FIXED 20>

and the following XML:

<J>
...
</J>

The xml_parse_into_struct function does NOT place the attribute "att=20"
into the struct.  Furthermore, if I change the XML to read:

<J att=45>
...
</J>

xml_parse_into_struct WILL place the attribute "att=45" into the struct
(so non-default attributes DO work), but in actuality, this should fail,
because the #FIXED keyword specifies that the value cannot be changed.

-MM
-- 
Edit bug report at http://bugs.php.net/?id=19562&edit=1
-- 
Try a CVS snapshot:  http://bugs.php.net/fix.php?id=19562&r=trysnapshot
Fixed in CVS:        http://bugs.php.net/fix.php?id=19562&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=19562&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=19562&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=19562&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19562&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=19562&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=19562&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=19562&r=submittedtwice
register_globals:    http://bugs.php.net/fix.php?id=19562&r=globals

Reply via email to