Re: [xml] How to select a node based on attribute values?



Yan,

I answered your question off list as it doesn't pertain to libxml2 but rather coding with domxml from PHP 4.

Seeing that there happens to be a good number of PHP based questions coming up, I'd like to make sure people are aware of the general PHP mailing list (php-general lists php net). The people that follow that list can probably better handled a lot of these questions.


Rob

Yan Seiner wrote:

I'm working with an embedded platform, so it took me a bit to get all of the required libxml stuff together and rebuild PHP with libxml support....

Now I have xpath working with PHP.   Yaay!

Ok, now for the PHP + xml question:

I am trying to get the base node of a schedule; I've attached a small portion of my XML file below. What I would like to do is to get the root of a schedule, and then iterate with foreach through all of the children. This is the function I came up with and of course it doesn't work. I don't understand how I am supposed to work with the object that the xpath_eval[_expression] returns. I've also tried the child_nodes method and that fails as well.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]