Query strings and namespaces

Matthew Graham mjg at cacr.caltech.edu
Mon Jun 28 17:27:26 PDT 2004


Hi,

Further to my post about namespaces in queries from Friday (where and
when do we use them), here is an example: 

- I want to find those services where the maximum number of records
returned is at least 100:

WHERE /resource/cs:capability/cs:maxRecords > 100 OR
      /resource/sia:capability/sia:maxRecords > 100

Of course, a more succinct way of writing this might be:

WHERE /resource/capability/maxRecords > 100

But this is no use to me if I only want to find ConeSearch's whose maximum
return is at least 100. Do I then need:

WHERE /resource[@xsi:type = 'cs:ConeSearch']/capability/maxRecords > 100

or:

WHERE /resource[@xsi:type = 'cs:ConeSearch']/cs:capabilty/cs:maxRecords >
100

Quite a bit of this is dependent on how the resource is specified in the
first place: if there is full namespace qualification in the XML 
(<resource>)  then you will need to use namespaces in the XPath
constructions or mess around with local-name() functions a lot.

	Cheers,

	Matthew



More information about the registry mailing list