using DomXML and getting the attribute tag

This is a discussion on using DomXML and getting the attribute tag within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Using PHP 4.4.8 and DomXML , how can I go about reading the following XML content? I don't ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 1 Week Ago
perry@fire-engine-red.com
 
Posts: n/a
Default using DomXML and getting the attribute tag

Using PHP 4.4.8 and DomXML , how can I go about reading the following
XML content? I don't need help reading the file, I need help obtaining
the "value" attribute of each element within the topmost element.

<?xml version="1.0" encoding="UTF-8"?>
<CustomStyle>
<StyleFormat.foreground value = "0xFFFFFF" />
<StyleFormat.background value = "0xFFFFFF" />
<TabTextColor value = "0xFFFFFF" />
</CustomStyle>

/** Code Start **/
$noderoot = $dom->document_element();
$childnodes = $noderoot->child_nodes();

// build the array and output the elements
foreach ($childnodes as $value) {
echo $value->tagname . " : " . $value->get_content() . " : ".
$value->get_attribute['value'] ."<br>";
$nodeArray[$value->tagname] = $value->get_content();
}
/** Code Finish **/
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:34 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0