NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP DOMXM LQuestion

Peter Sawczynec ps at pswebcode.com
Sat May 21 10:42:09 EDT 2005


Rescind this query. Works fine as wine. Peter

-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Peter Sawczynec
Sent: Friday, May 20, 2005 10:01 PM
To: 'Org, Talk at Nyphp.'
Subject: [nycphp-talk] PHP DOMXM LQuestion


For the life of me, I can't get the domxml set_content() method to work on a
node. 
I can do get_content() on the node. 
How does one update a single node? 

For example:
The following read process works:
$xml = join('',file('listings_list.xml'));
$dom = domxml_open_mem($xml);
$xpObj = xpath_new_context($dom);
$resObj = xpath_eval($xpObj, "//listing[@id=$id]");
$theOne = $resObj->nodeset[0];
$y1Element = $theOne->get_elements_by_tagname('images1');
$i1 = $y1Element[0]->get_content();
echo $i1

The self-same update does not:
$xml = join('',file('listings_list.xml'));
$dom = domxml_open_mem($xml);
$xpObj = xpath_new_context($dom);
$resObj = xpath_eval($xpObj, "//listing[@id=$id]");
$theOne = $resObj->nodeset[0];
$y1Element = $theOne->get_elements_by_tagname('images1');
$y1Element[0]->set_content();



Warmest regards,

Peter Sawczynec
Technology Director
PSWebcode
ps at pswebcode.com
718.543.3240


_______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org





More information about the talk mailing list