source: exist/trunk/xquery/molesObjectType.xq @ 3841

Subversion URL:
Revision 3841, 795 bytes checked in by cbyrom, 11 years ago (diff)

Various updates to the xquery files - to remove usage of invalid specs
and dependency on obsolete function calls. Also add the inputParse_xquery_lib.xquery
file - referenced from the xquery files but not currently included in codebase.
NB, changes made to allow use of Saxon java library to do xqueries - to
remove the need for the discovery service eXist DB.

  • NB, also changes tested by comparing saxon transforms to eXist ones; these

were found to be identical.

1(: For TargetCollection, RepositoryID, LocalID return the moles object type keyed as
2     0 - unknown, 1 - activity, 2 - DPT, 3 - ObsStn, 4 - DataEntity :)
3declare default element namespace '';
4declare variable $targetCollection as xs:string := 'TargetCollection';
5for $Obj in collection($targetCollection)/dgMetadata/dgMetadataRecord[dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier='RepositoryID' and dgMetadataID/localIdentifier='LocalID']
6return <objectType>{if (exists($Obj/dgDataEntity)) then 4
7                   else (if (exists($Obj/dgObservationStation)) then 3
8                   else (if (exists($Obj/dgDataProductionTool)) then 2
9                   else (if (exists($Obj/dgActivity)) then 1 else (0))))}
10       </objectType>
Note: See TracBrowser for help on using the repository browser.