As of PHP 5.1, why aren't there functions that return a node's
children, a node's first/last/nth child, a node's parent/previous
sibling/next sibling, etc., as in the DOM specification? How are you
currently meant to traverse a DOM tree without these functions? Or
perhaps they exist somewhere in the documentation, but not under the
list of DOM functions - if so, where are they?
Rodney 5 1705 r_*****@yahoo.com wrote: As of PHP 5.1, why aren't there functions that return a node's children, a node's first/last/nth child, a node's parent/previous sibling/next sibling, etc., as in the DOM specification? How are you currently meant to traverse a DOM tree without these functions? Or perhaps they exist somewhere in the documentation, but not under the list of DOM functions - if so, where are they?
Rodney
Hi Rodney,
That is like asking: "Where are the rocket blueprints for the Saturn5 in
PHP?"
PHP is executed at the server, and returns a response, which can be HTML.
If you want to use DOM-specific functionality, this is executed by the
browser that receives the HTML produced by PHP.
PHP is completely out-of-touch with the HTML it delivered.
You need Javascript to access DOM in a browser.
Of course, this doesn't mean PHP cannot be used to deliver nice
Javascript/HTML/etc, but PHP is NOT in charge anymore once the HTML arrives
at some client (browser).
Regards,
Erwin Moller
"Erwin Moller"
<si******************************************@spam yourself.com> wrote in
message news:44***********************@news.xs4all.nl... r_*****@yahoo.com wrote:
As of PHP 5.1, why aren't there functions that return a node's children, a node's first/last/nth child, a node's parent/previous sibling/next sibling, etc., as in the DOM specification? How are you currently meant to traverse a DOM tree without these functions? Or perhaps they exist somewhere in the documentation, but not under the list of DOM functions - if so, where are they?
Rodney
Hi Rodney,
That is like asking: "Where are the rocket blueprints for the Saturn5 in PHP?"
PHP is executed at the server, and returns a response, which can be HTML. If you want to use DOM-specific functionality, this is executed by the browser that receives the HTML produced by PHP.
PHP is completely out-of-touch with the HTML it delivered.
You need Javascript to access DOM in a browser.
While I agree with the fact that the question was a bit odd, I think it
could actually mean another DOM tree, such as an XML DOM instead of HTML.
Perhaps the original poster is referring to some XML parser, who knows.
Point is that HTML isn't the only possibility here.
--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
Yes, I'm talking about XML DOM. See Section VI-XXX. DOM Functions and
SectionVI-CLXVIII. XML Parser Functions, etc. As I understand it, all
these functions are used in PHP scripts on the server to process XML
documents as DOM trees in memory. (I'm not referring to HTML DOM which
is indeed used by JavaScript on the client.)
Rodney Topor wrote: Yes, I'm talking about XML DOM. See Section VI-XXX. DOM Functions and SectionVI-CLXVIII. XML Parser Functions, etc. As I understand it, all these functions are used in PHP scripts on the server to process XML documents as DOM trees in memory. (I'm not referring to HTML DOM which is indeed used by JavaScript on the client.)
Hi Rodney
In the DOM functions childNodes,first/lastChild and parentNode are
properties of DomNodes
They are listed in the table just below the function list http://www.php.net/manual/en/ref.dom....class.domnode
You're not the only one who a problem finding them. I searched the
table of contents for ages wondering how I could use a dom without
childNodes...
Tim
Tim, Thank you! That answers my question. Glad to learn I am not
alone. Case closed!
Rodney This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jeff |
last post by:
I'd like to write an XPath expression that gets a node with 2
particular children.
I thought this would work:
/AAA/BBB/CCC/following-silbing::DDD/parent::node()
on xml like this:
AAA
BBB
|
by: Ha |
last post by:
I am trying to move a node of a tree up one level.
Example: I want to move C to be a child of A, then remove B.
Before:
<A>
<B>
<C>
<D/>
<E/>
</C>
|
by: Ryan Stewart |
last post by:
Putting the following code in a page seems to make it go into an infinite
loop unless you give it a very simple node to work with. Either that or it's
very very slow. I'm somewhat new to this,...
|
by: Urs Vogel |
last post by:
Hi
When using XmlDocument, I can create nodes and attributes as I like. What I
didn't achieve is changing the Value of a node (created with createElement),
it claims that it's the wrong node...
|
by: Brian Henry |
last post by:
If i already have a tree view created, and want to add another new node to
it, how would i do so? Is there a way to throught tags or anything? like i
have this
RootNode
|
+-- Child 1
+--...
|
by: Don Wash |
last post by:
Hi There!
I'm using VB.NET to create a TreeView application and unfortunately I could
not find "Key" property in Node items of the TreeView.
We used to have "Key" property in TreeView node...
|
by: Tom |
last post by:
Hello everyone,
I found a frustrating behavior in the TreeView control in .NET 2.0.
The TreeNode that is passed in the TreeNodeMouseClickEventArgs is
incorrect when the TreeView automatically...
|
by: Guzeppi |
last post by:
Hi,
i'm using linq to load an xml structure into my classes. the xml consists of
the same node nested for multiple levels e.g.
<node id="node_id01" name="node 01">
<node id="node_id0101"...
|
by: MrPickle |
last post by:
I have a structure like so:
struct node
{
float x, y, z;
std::vector<node> children;
};
and I want to loop through all the node's children, then all the children's children then all the...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |