Come to think of it there is one final thing that's been bugging me and that's how to actually implement an XQuery file?
I have tested this xquery against my xml file and it works. Here's the xquery
Code:
declare namespace geo = "http://www.dur.ac.uk/geo-engineering";
declare namespace gml = "http://www.opengis.net/gml";
for $x in doc("Slope.xml")/geo:slopeData/geo:case/geo:slope/geo:toe/geo:location/gml:Point[@srsName='EPSG:27700']
return $x/gml:pos
Only a simple example (I have created more advanced ones ! So this simply returns the values requested from within the file Slope.xml given that the xquery file is placed in the same directory. I have used oXygen to check it.
If a user comes on to my site and sees a HTML table listing all of the Slope.xml files added to the system (whereby the table is updated by a php script each time a new one is submitted) but wants to find all of the files that can match some XQuery expression (such as the one above) then how does he do it? I guess I need to provide some functionality for this process, in which case, what can I do to allow this? I have jQuery-powered sorting fields for my table columns but a user may wish for a more in depth ordering according to some other content from the XML files stored. (The Slope.xml files are stored in a location 'SlopeCase/inventory/Case[ID]/Slope.xml' (where [ID] is the case's ID number).
The simplest example would be to query these files with 'retrieve all of the Slope.xml files that have a slope angle of greater than 30degrees'.
OK you probably get my point by now! I'm just confused as to how this is implemented in practice.
Thanks
edit: Just to clarify, I am talking about an online way of achieving this. I realise that I could write some scripts for them that query from their desktop to the site, such as :
Code:
declare namespace geo = "http://www.dur.ac.uk/geo-engineering";
declare namespace gml = "http://www.opengis.net/gml";
for $x in doc("http://www.example.com/SlopeCase/inventory/[ID]/Slope.xml")/geo:slopeData/geo:case/geo:slope/geo:toe/geo:location/gml:Point[@srsName='EPSG:27700']
return $x/gml:pos
I realise most people using the site will probably have XML editors that can perform queries such as this, but some may not and may wish to search current submissions that relate to their slope problem (case-based design help). I would therefore ultimately like to provide form-like XQueries - for example with the slope angle idea there could be a form which specifies the slope angle parameters they wish to search for, these submit in to the xQuery form and then show them the resultant list of matches cases. I guess all of this is possible and perhaps not that tricky ?
The eventual idea is to be able to query all known sites/servers that hold this form of XML application data and return results of interest to the user. So then the database is essentially all over the world. To begin with though it would be nice if I could actually perform simple searches on my own site but this is what I've described above. thanks