Bug #66684 [NEW]: Issue with recurring elements and attributes

From: Date: Mon, 10 Feb 2014 12:31:15 +0000
Subject: Bug #66684 [NEW]: Issue with recurring elements and attributes
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184237@lists.php.net to get a copy of this message
From: rasmus at 3kings dot dk Operating system: PHP version: Irrelevant Package: SimpleXML related Bug Type: Bug Bug description:Issue with recurring elements and attributes Description: ------------ I have an XML file <http://www.mercurymarine.dk/public/export/XMLalleprodukter.xml> with a recurrence of the element <specification>. When loaded in SimpleXML i get the following structure (note that the top level has attributes defined whereas <specification> does not). --- From manual page: http://www.php.net/simplexmlelement.attributes --- Test script: --------------- print_r(SimpleXMLElement(file_get_contents("http://www.mercurymarine.dk/public/export/XMLalleprodukter.xml"))); Expected result: ---------------- ... something that allows me to read the attributes of the <specification> elements. Actual result: -------------- SimpleXMLElement Object ( [@attributes] => Array ( [type] => Påhængsmotorer [id] => 17827 [produkttype] => nyt [forhandlertype] => importør ) [title] => Mercury 30MLH 2-takt [dealer_name] => SimpleXMLElement Object ( ) [dealer_address] => Sundvej 12 F [dealer_postalcode] => 4600 [dealer_city] => Køge [dealer_email] => mads@jdas.dk [dealer_phone] => 4049 2920 [dealer_webadresse] => www.mercurymarine.dk [description] => Sælges kun til erhvervsbrug. MED/SOLAS godkendt. Download godkendelses certifikat fra højre spalte. [price] => 27120.00 [url] => www.mercurymarine.dk/produkter/motorer/solasogmedgodkendtepaahaengsmotorer/mercurymedsolag2-taktmotorer/me-30mlh.html [picture] => Array ( [0] => http://www.mercurymarine.dk/public/billeder/produkter-jpg/Motorer/Mercury/ME_2takt/ME_2takt30cc429/Me$2s$F250-2_5$30cc429.jpg [1] => http://www.mercurymarine.dk/gfx/imager/produkter-jpg/Motorer/Mercury/ME_2takt/ME_2takt30cc429/Me$2s$F250-2_5$30cc429.jpg?s=product ) [specification] => Array ( [0] => Påhængsmotor [1] => 1,92:1 [2] => 508mm [3] => 30.00 [4] => 6 [5] => F-F-B [6] => 2 [7] => 22,1 [8] => 429 [9] => 51 [10] => 6 [11] => Manuel [12] => 4800-5500 [13] => Styrehåndtag [14] => 1 karburator [15] => 2-takt [16] => for fejl og ændringer i specifikationerne ) ) -- Edit bug report at https://bugs.php.net/bug.php?id=66684&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66684&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66684&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66684&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66684&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66684&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66684&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66684&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66684&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66684&r=support Expected behavior: https://bugs.php.net/fix.php?id=66684&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66684&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66684&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66684&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66684&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66684&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66684&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66684&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66684&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66684&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66684&r=mysqlcfg

« previous php.bugs (#184237) next »