ID:               49666
 User updated by:  ralph at bean-it dot nl
 Reported By:      ralph at bean-it dot nl
 Status:           Bogus
 Bug Type:         DOM XML related
 Operating System: Windows
 PHP Version:      5.3.0
 New Comment:

Yes I have seen this, but this error was not raised before we went to
php 5.3. The application and the setAttribute works fine till now. I was
wandering why.

But thanks for the reply


Previous Comments:
------------------------------------------------------------------------

[2009-09-25 10:43:50] [email protected]

Thank you for your report.

The behavior you describe is not a bug. XML attributes can not contain
spaces and can not start with a number. See the XML spec for more
information:
http://www.w3.org/TR/REC-xml/#attdecls

------------------------------------------------------------------------

[2009-09-25 10:09:12] ralph at bean-it dot nl

Description:
------------
An invalid character error is raised when I want to set an attribute on

a DomElement.

When I put my code in a try ... catch everything works fine

Reproduce code:
---------------
$doc = new DOMDocument('1.0', 'iso-8859-1');
$node = $doc->createElement('test');
$newnode = $doc->appendChild($node);
$newnode->setAttribute("name application", "MyApp");

Raises an error

$newnode->setAttribute("0001", "File");
Also raises an error
                

Expected result:
----------------
The attribute is set on my DomElement

Actual result:
--------------
'DOMException' with message 'Invalid Character Error'


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=49666&edit=1

Reply via email to