php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15918 DomAttribute missing "type" property
Submitted: 2002-03-06 19:37 UTC Modified: 2002-03-07 15:58 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: bigredlinux at yahoo dot com Assigned: jtate (profile)
Status: Closed Package: DOM XML related
PHP Version: 4.1.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bigredlinux at yahoo dot com
New email:
PHP Version: OS:

 

 [2002-03-06 19:37 UTC] bigredlinux at yahoo dot com
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-07 10:15 UTC] jtate@php.net
This should be a quick fix.
 [2002-03-07 11:19 UTC] bigredlinux at yahoo dot com
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 11:37 UTC] jtate@php.net
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 14:32 UTC] jtate@php.net
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 15:58 UTC] bigredlinux at yahoo dot com
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 04:01:38 2024 UTC