TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Advanced PHP Programming (http://www.talkphp.com/advanced-php-programming/)
-   -   Get PHP Dom value, when creating XML (http://www.talkphp.com/advanced-php-programming/5078-get-php-dom-value-when-creating-xml.html)

nuweb 11-01-2009 01:39 PM

Get PHP Dom value, when creating XML
 
Hello All,

I have created a little API that allows me to design a mysql query and it builds an XML document for me, useing PHP dom.

It works well, except I need to get the Value of an element created by the dom. ( so another query can be made, from its value).

Here is the END xml document.

I need to get the value of xmlz->category->cat_id so that I use it for the query to get each xmlz->items.

I keep reading dom manual, but everything I try has no success yet.
Thanks in advance.

nuweb 11-01-2009 02:33 PM

PHP Code:

echo $dom->getElementsByTagName("cat_id")->item(0)->nodeValue

This code works, if theirs no objections I think this will work well.


All times are GMT. The time now is 02:33 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0