Hi,
I have an XML document with a basic structure like this:
<?xml version="1.0" encoding="UTF-8" ?>
<records timestamp="1264777862">
<record></record>
<record></record>
<record></record>
<record></record>
</records>
I've been using the following so far:
$doc = new DOMDocument();
$doc->load('myfile.xml');
$xpath = new DOMXPath($doc);
$timestamp = $xpath->query("/records@timestamp");
But this gives me an invalid expression error.
What would be the correct PHP/XPath expression syntax to use to obtain the timestamp attribute of the root?
Any advice appreciated.
Thanks.