Hello, I am getting to know Basex702. I downloaded the war and its receiving requests at http://localhost:8080/BaseX702/rest (tomcat servlet container)
I am using curl to query the REST urls for results. I used the command below to populate the initial data
*$$ curl -i -X PUT -H "Content-Type: application/xml" -T "/tmp/bv_letsbuycom_standard_client_feed.xml" "admin:admin@localhost :8080/BaseX702/rest/bvstandard"*
To confirm the PUT above i do this:
*$$ curl -i "admin:admin@localhost:8080/BaseX702/rest/bvstandard"* .... ...... <rest:database name="bvstandard" resources="1" xmlns:rest=" http://www.basex.org/rest%22%3E <rest:resource type="xml" content-type="application/xml" size="828733">bvstandard.xml</rest:resource> </rest:database>
Another confirmation
*$$ curl -i "admin:admin@localhost :8080/BaseX702/rest/bvstandard/bvstandard.xml"* * * The above shows the entire xml. So the data got loaded fine i believe.
Now i am stuck. a query like below is not resulting any results. The xml document surely contains the path and data.
*$$ curl -i "admin:admin@localhost :8080/BaseX702/rest/bvstandard?query=/Feed/Product&wrap=no"*
There are multiple Product elements under the Feed element. And the above query returns empty results. I know i am doing something fundamentally wrong, but not sure what.
However, a request like
*$$ curl -i "admin:admin@localhost :8080/BaseX702/rest/bvstandard?query=//@id"* * * Shows results as expected, ie all the attributes *id * and its values are displayed.
Please help. Aren't the values of query param in the GET url above, a XPATH expression? How to i execute a xpath on the DB to get the results, using the REST interface.
The main purpose is to get some 100 MB large xml file into BaseX and then query it using a php client and display results on a web page.
We at letsbuy.com is really interested in integrating BaseX in our application for handling all the XML feeds we consume.
Please advice.
Thanks, Subhro.
I solved the issue. The document i loaded had its own namespace set. So "declare namespace" sorted out the issue. I am on way forward!!
Thanks all for a great open source product.
Cheers, Subhro.
On Fri, Dec 9, 2011 at 2:19 PM, Subhro Moitra smoitra@letsbuy.com wrote:
Hello, I am getting to know Basex702. I downloaded the war and its receiving requests at http://localhost:8080/BaseX702/rest (tomcat servlet container)
I am using curl to query the REST urls for results. I used the command below to populate the initial data
*$$ curl -i -X PUT -H "Content-Type: application/xml" -T "/tmp/bv_letsbuycom_standard_client_feed.xml" "admin:admin@localhost :8080/BaseX702/rest/bvstandard"*
To confirm the PUT above i do this:
*$$ curl -i "admin:admin@localhost:8080/BaseX702/rest/bvstandard"* .... ...... <rest:database name="bvstandard" resources="1" xmlns:rest=" http://www.basex.org/rest%22%3E <rest:resource type="xml" content-type="application/xml" size="828733">bvstandard.xml</rest:resource> </rest:database>
Another confirmation
*$$ curl -i "admin:admin@localhost :8080/BaseX702/rest/bvstandard/bvstandard.xml"*
The above shows the entire xml. So the data got loaded fine i believe.
Now i am stuck. a query like below is not resulting any results. The xml document surely contains the path and data.
*$$ curl -i "admin:admin@localhost :8080/BaseX702/rest/bvstandard?query=/Feed/Product&wrap=no"*
There are multiple Product elements under the Feed element. And the above query returns empty results. I know i am doing something fundamentally wrong, but not sure what.
However, a request like
*$$ curl -i "admin:admin@localhost :8080/BaseX702/rest/bvstandard?query=//@id"*
Shows results as expected, ie all the attributes *id * and its values are displayed.
Please help. Aren't the values of query param in the GET url above, a XPATH expression? How to i execute a xpath on the DB to get the results, using the REST interface.
The main purpose is to get some 100 MB large xml file into BaseX and then query it using a php client and display results on a web page.
We at letsbuy.com is really interested in integrating BaseX in our application for handling all the XML feeds we consume.
Please advice.
Thanks, Subhro.
basex-talk@mailman.uni-konstanz.de