ID: 15918 Updated by: [EMAIL PROTECTED] -Summary: DomAttribute missing "type" property Reported By: [EMAIL PROTECTED] Status: Closed Bug Type: DOM XML related Operating System: Linux PHP Version: 4.1.2 Assigned To: jtate New Comment:
It appears that the logic for the nodeName has already been implemented...(search in the C code for #comment or #cdata-section and you will arrive at the switch statement). So all the code is there, it just seems like mode DOM Classes don't have this function "attached" for whatever reason. If you just attach this function domxml_node_name then it should be done. Also, it seems only logical to attach the function domxml_node_type to all of the DOM Classes (just a thought)...the page on W3C for nodeNames is: http://www.w3.org/TR/2002/WD-DOM-Level-3-Core-20020114/core.html#ID-1950641247 just cruise down a little bit from that anchor and you will see the table (first one you come to). But like I said, I am certain the functions are already prepared in the php C code. Previous Comments: ------------------------------------------------------------------------ [2002-03-07 14:32:23] [EMAIL PROTECTED] I'm closing this bug. It's been committed both to HEAD and PHP_4_2_0. I will open a feature request for setting nodeNames for each node. Please send me the link to the page you refer to on the w3c page. ------------------------------------------------------------------------ [2002-03-07 11:37:30] [EMAIL PROTECTED] I've added type nodes to DomAttributes. (I also added them to CDATA nodes too). I'll take a look at the name stuff, but it will require a little more time to look into. I'll get the type nodes into the 4.2.0 release tree so that it'll be in the next release. ------------------------------------------------------------------------ [2002-03-07 11:19:05] [EMAIL PROTECTED] Let me allow myself to be less ambiguous on the last comment I made. It would be nice if every class also consistently had a property for the name (no need for function I guess, since it would not be in the way of the current design to make a function to return every property). The reason I say this is because often times, in the case of classes such as DomText, the name is actually just "#text" and DomDocument is "#document". There is a chart on the w3c page for the nodeNames that correspond to the different classes and without this property consistent for every php DOM class, I have to use a huge switch statement to run through the different types of nodes and figure out what the name would be. Just seems like a trivial fix that would make the classes more complete. Thanks! ------------------------------------------------------------------------ [2002-03-07 10:15:06] [EMAIL PROTECTED] This should be a quick fix. ------------------------------------------------------------------------ [2002-03-06 19:37:26] [EMAIL PROTECTED] It appears that the type property is missing from the DomAttribute class, which makes it quite difficult to determine the type of node, since it is necessary to code a workaround for cases where this property is missing. It would be nice if there was a function nodeType that would return this, and possibly a function nodeName to return other rather case sensitive results. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=15918&edit=1