Changeset 5179


Ignore:
Timestamp:
07/04/09 14:36:42 (10 years ago)
Author:
cbyrom
Message:

Update atom2DIF to include the new atom data fields when creating
DIF docs.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • exist/trunk/xquery/atom2DIF.xq

    r4436 r5179  
    33declare namespace dif = 'http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/'; 
    44declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance'; 
    5 declare namespace moles="http://ndg.nerc.ac.uk/schema/moles2alpha"; 
     5declare namespace moles="http://ndg.nerc.ac.uk/schema/moles2beta"; 
    66declare namespace f='http://ndg.nerc.ac.uk/moles/localfunctions'; 
    77declare namespace georss = "http://www.georss.org/georss"; 
     
    1414declare variable $dataEntitiesDir as xs:string := '/data_entities'; 
    1515declare variable $repositoryIdentifier as xs:string := 'badc.nerc.ac.uk'; 
    16 declare variable $localIdentifier as xs:string := 'dataent_active'; 
     16declare variable $localIdentifier as xs:string := 'badc.nerc.ac.uk__ATOM__dataent_active'; 
    1717declare variable $dptTerm as xs:string := 'DPTTerm'; 
    1818declare variable $obsTerm as xs:string :=  'OBSTerm'; 
     
    2424declare variable $targetCollection as xs:string := 'TargetCollection'; 
    2525declare variable $repositoryIdentifier as xs:string := 'RepositoryID'; 
    26 declare variable $localIdentifier as xs:string := 'LocalID'; 
     26declare variable $localIdentifier as xs:string := 'RepositoryID__ATOM__LocalID$'; 
     27 
    2728declare variable $dptTerm as xs:string := 'DPT - NOT YET SET UP/None/DPT'; 
    2829declare variable $obsTerm as xs:string :=  'OBS - NOT YET SET UP/None/OBS'; 
     
    3738declare variable $deploymentDataDir as xs:string := 'deployment_data'; 
    3839 
    39 for $DE in collection(string-join(($targetCollection, $dataEntitiesDir, $repositoryIdentifier), '/'))/atom:entry[matches(atom:id, concat('__ATOM__',$localIdentifier,'$'))] 
     40declare variable $atomCollection as xs:string := concat('TargetCollection', $dataEntitiesDir, '/', 'RepositoryID');  
     41 
     42for $DE in collection($atomCollection)/atom:entry[matches(atom:id, $localIdentifier)] 
    4043return 
    4144element DIF { 
     
    111114                }, 
    112115 
    113         element Data_Resolution {''}, 
     116        element Data_Resolution {string($DE/moles:entity/moles:molesISO/moles:spatialResolution)}, 
    114117 
    115118        for $val in distinct-values( 
     
    128131                    }, 
    129132 
    130         element Quality {''}, 
     133        element Quality {string($DE/moles:entity/moles:molesISO/moles:quality)}, 
    131134        element Use_Constraints {''}, 
    132         element Data_Set_Language {''}, 
     135        element Data_Set_Language {string($DE/moles:entity/moles:molesISO/moles:datasetLanguage)}, 
    133136        element Distribution {''}, 
    134137        element Multimedia_Sample {''}, 
  • ndgCommon/trunk/ndg/common/xmldb/xquery/atom2DIF.xq

    r4981 r5179  
    114114                }, 
    115115 
    116         element Data_Resolution {''}, 
     116        element Data_Resolution {string($DE/moles:entity/moles:molesISO/moles:spatialResolution)}, 
    117117 
    118118        for $val in distinct-values( 
     
    131131                    }, 
    132132 
    133         element Quality {''}, 
     133        element Quality {string($DE/moles:entity/moles:molesISO/moles:quality)}, 
    134134        element Use_Constraints {''}, 
    135         element Data_Set_Language {''}, 
     135        element Data_Set_Language {string($DE/moles:entity/moles:molesISO/moles:datasetLanguage)}, 
    136136        element Distribution {''}, 
    137137        element Multimedia_Sample {''}, 
Note: See TracChangeset for help on using the changeset viewer.