Hello all.
Im writing a parser for an XML document using DOM. This is my first time. 😃 My question is this:
All i want to do is extract a single value from the file. This value is located in the following place:
- <root element>
- <1st_element>
- <2nd_element>
- <1st_child_of_2nd_element>
- <2nd_child_of_2nd_element> [COLOR=red]<--- Im interested in the childeren of this one. [/COLOR]
- </2nd_element>
.
.
.
Now i know i could probably access that element using the following code, but recon there must be a simpler way.
$root = $doc->document_element();
$1st_element= $root->child_nodes();
$1st_element= $1st_element->first_child();
$2nd_element= $1st_element->child_nodes();
$2nd_element= $2nd_element->first_child();
$2nd_child_of_2nd_element= $2nd_element->child_nodes();
$2nd_child_of_2nd_element= $2nd_child_of_2nd_element->last_child();
Does anyone have any suggestiongs...?!?!
TYIA