Bug #61597 [NEW]: SimpleXML drops attributes for tags with both attributes and text
From:
Operating system: Mac OS X
PHP version: 5.3.10
Package: SimpleXML related
Bug Type: Bug
Bug description:SimpleXML drops attributes for tags with both attributes and text
Description:
------------
When loading XML into SimpleXML, tags which have both attributes and text
will have their attributes dropped.
For example, loading this into SimpleXML:
<sometag attribute="value">Here is some text</sometag>
Will cause 'attribute="value"' to be lost. If there is no text w/in a tag,
but attributes, the attributes and their values are preserved.
I'm not the only PHP developer to notice this bug; please see:
http://stackoverflow.com/questions/8563073/disappearing-attributes-in-php-simplexml-object
I didn't see this bug reported on php.net, however.
Test script:
---------------
See above.
Expected result:
----------------
Tags with both attributes and text should not have their attributes
dropped.
--
Edit bug report at https://bugs.php.net/bug.php?id=61597&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61597&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61597&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61597&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=61597&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61597&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=61597&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=61597&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=61597&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=61597&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=61597&r=support
Expected behavior: https://bugs.php.net/fix.php?id=61597&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=61597&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=61597&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=61597&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61597&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=61597&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=61597&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=61597&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=61597&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=61597&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=61597&r=mysqlcfg
Thread (13 messages)
- drgroove at gmail dot com
- aharvey@php.netBug #61597 [Opn->Fbk]: SimpleXML drops attributes for tags with both attributes and text
- jplyon dot csu at gmail dot comBug #61597 [Com]: SimpleXML drops attributes for tags with both attributes and text
- aharvey@php.netBug #61597 [Fbk->Opn]: SimpleXMLElement doesn't include both @attributes and textContent in properties
- hugh at infomenta dot comBug #61597 [Com]: SimpleXMLElement doesn't include both @attributes and textContent in properties
- dbai at drivenbi dot comBug #61597 [Com]: SimpleXMLElement doesn't include both @attributes and textContent in properties
- tlesher at mtadistributors dot comBug #61597 [Com]: SimpleXMLElement doesn't include both @attributes and textContent in properties
- cmb@php.netBug #61597 [Opn]: SimpleXMLElement doesn't include both @attributes and textContent in properties
- cmb@php.netBug #61597 [Opn->Ver]: SimpleXMLElement doesn't include both @attributes and textContent in properties
- cmb@php.netBug #61597 [PATCH]: SimpleXMLElement doesn't include both @attributes and textContent in properties
- cmb@php.netBug #61597 [Ver]: SimpleXMLElement doesn't include both @attributes and textContent in properties
- cmb@php.netBug #61597 [Ver->Csd]: SimpleXMLElement doesn't include both @attributes and textContent in properties
- cmb@php.netBug #61597 [Csd->ReO]: SimpleXMLElement doesn't include both @attributes and textContent in properties