Ignore:
Timestamp:
30/01/07 11:26:29 (13 years ago)
Author:
ko23
Message:

XQuery refactoring process - part one...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/DIF/XQuery/NDG-DIF.xquery

    r2056 r2077  
     1import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; 
    12declare default element namespace 'http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/'; 
    23declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance';  
     
    1011        and moles:dgMetadataID/moles:localIdentifier='HGFS3751'] 
    1112return 
    12     element DIF { 
     13element DIF { 
    1314        attribute xsi:schemaLocation {'http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/ http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/dif_v9.4.xsd'}, 
    14         element Entry_ID {concat($DE/moles:dgMetadataID/moles:repositoryIdentifier, ':DIF:', $DE/moles:dgMetadataID/moles:localIdentifier)}, 
     15        element Entry_ID {concat($DE/moles:dgMetadataID/moles:repositoryIdentifier, '__DIF__', $DE/moles:dgMetadataID/moles:localIdentifier)}, 
    1516        element Entry_Title {string($DE/moles:name)}, 
    1617        element Data_Set_Citation { 
     
    2930            element Dataset_Title {string($DE/moles:name)} 
    3031        }, 
    31         for $StructuredKeyword in ($DE//(moles:dgStructuredKeyword | moles:dgStdParameterMeasured)[moles:dgValidTermID/moles:ParentListID='http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_parameters.html' and moles:ListLevel = 0]) 
     32        for $StructuredKeyword in ($DE//(moles:dgStructuredKeyword | moles:dgStdParameterMeasured)[voclib:spot-vocab($voclib:gcmd_science_valids, moles:dgValidTermID/moles:ParentListID) and moles:ListLevel = 0]) 
    3233                return if (exists($StructuredKeyword/*/moles:dgValidTerm)) then  
    3334                    element Parameters { 
     
    165166                        for $DGID in $DE/moles:dgDataEntity/moles:dgDataGranule/moles:dataModelID 
    166167                        return  
    167                             element Data_Set_ID {concat($DGID/moles:repositoryIdentifier, ':', $DGID/moles:schemeIdentifier, ':', $DGID/moles:localIdentifier)}, 
     168                            element Data_Set_ID {concat($DGID/moles:repositoryIdentifier, '__', $DGID/moles:schemeIdentifier, '__', $DGID/moles:localIdentifier)}, 
    168169                        element  Personnel { 
    169170                                element Role {'Data Center Contact'}, 
Note: See TracChangeset for help on using the changeset viewer.