Hi.
I've got this simple xml file:
<?xml version="1.0" encoding="utf-8"?>
<items>
<item>
<time>1169838286</time>
<title>Tre</title>
<author>Tre</author>
<content>TRE his module defines a number of classes, which are explained in the following tables. Classes with an equivalent in the DOM standard are named DOMxxx.
This module defines a number of classes, which are explained in the following tables. Classes with an equivalent in the DOM standard are named DOMxxx.TRE
</content>
</item>
<item><time>1169838</time>
<title>Tre</title>
<author>Tre</author>
<content>TRE his module defines a number of classes, which are explained in the following tables. Classes with an equivalent in the DOM standard are named DOMxxx.
This module defines a number of classes, which are explained in the following tables. Classes with an equivalent in the DOM standard are named DOMxxx.TRE
</content>
</item>
<item>
<time>11698286</time>
<title>Tre</title>
<author>Tre</author>
<content>TRE his module defines a number of classes, which are explained in the following tables. Classes with an equivalent in the DOM standard are named DOMxxx.
This module defines a number of classes, which are explained in the following tables. Classes with an equivalent in the DOM standard are named DOMxxx.TRE
</content>
</item>
</items>
To get all the item nodes I've
got this code:
$xp = new domxpath($dom);
$titles = $xp->query("/items/item");
foreach ($titles as $node) {
print $node->firstChild->data . "\n";
}
Is there a way
to get only the item with
time=1169838 for instance ?
I'm looking for good tutorials
to using domxpath
Thanks in advance.
Bye.