Hi!
I am to make a php file that queries an xml file with the php class Xquery_lite.
I've found much about xquery in general, but little together with php.
I've downloaded the class and it works (xquery_lite) from:
http://sourceforge.net/projects/phpxmlclasses/
Instructions/API for the class:
http://phpxmlclasses.sourceforge.net/class_xquery_lite.html
http://phpxmlclasses.sourceforge.net/xquery_lite.html
Many xqueries are described, but how do I get these xml results into php variables?
Does anyone have an example implemented in php?
If anyone can help me to return anything from the below xml file it would be great!
Any advice is appreciated!
Best regards,
Tom-Erik
This is my php file:
<html>
<body>
<?php
include "C:\php4\class\class_xquery_lite\class_xquery_lite.php";
$xq=new XqueryLite();
$xq->init();
$result=$xq->evaluate_xqueryl($query);
echo "hello";
{
for $a in document("foo.xml")//name
return {$a}
}
echo "hello2";
?>
</body>
</html>
the xml file is:
<?xml version="1.0" encoding ="ISO-8859-1"?>
<test_root>
<name>foo</name><name>John</name>...<name>Peter</name>
</test_root>