ID: 37010
User updated by: hari_sayiri at rediffmail dot com
Reported By: hari_sayiri at rediffmail dot com
-Status: Feedback
+Status: Open
Bug Type: DOM XML related
Operating System: windows 200
PHP Version: 5.1.2
New Comment:
<?php
$objDOM = new DOMDocument();
$xml = $_POST['config'];
$objDOM->loadXML($string);
$map = $objDOM->getElementsByTagName("map")->item(0);
$mapsize = $map->getAttribute('size');
echo $mapsize;
?>
Previous Comments:
------------------------------------------------------------------------
[2006-04-07 16:36:11] [EMAIL PROTECTED]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.
If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.
Cannot reproduce.
------------------------------------------------------------------------
[2006-04-07 16:30:45] hari_sayiri at rediffmail dot com
Description:
------------
I am posting a string from a vb.net pogram to a php program, the string
is basically xml tags, i am able to get the string in php, but when u
try to load the string using loadxml function i get the warning message
Warning: DOMDocument::loadXML() [function.loadXML]: Start tag expected,
'<' not found in Entity
and so i am unable to retrieve the tag attributes and values.
Reproduce code:
---------------
$objDOM->loadXML($string);
where $string is <?xml version='1.0' encoding='UTF-8'?><map><mapsize
size='2500 2500'/> </map>
Expected result:
----------------
i should get the attribute value into a variable by using dom functions
$map = $objDOM->getElementsByTagName("map")->item(0);
$mapsize = $map->getAttribute('size');
Actual result:
--------------
getting the above warning message and
Fatal error: Call to a member function getAttribute() on a non-object
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37010&edit=1