Changeset 7880 for ndgCommon


Ignore:
Timestamp:
09/02/11 12:01:32 (8 years ago)
Author:
sdonegan
Message:

Updated to provide better compliant NERC DMS records and also to pick up improved metadata collection in CEDA atoms from DSR process.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ndgCommon/trunk/ndg/common/xmldb/xquery/lib/Utilities/isoUtilities_xquery_lib.xquery

    r7730 r7880  
    1 module namespace isolib='http://ndg.nerc.ac.uk/xquery/lib/iso_utilities'; 
     1module namespace isolib='http://ndg.nerc.ac.uk/xquery/lib/iso_utilities'; 
    22 
    33(: ISO namespaces :) 
     
    3737{ 
    3838    element gmd:contactInfo  
    39     { 
     39    {         
    4040        element gmd:CI_Contact  
    4141        { 
     
    6666                    }, 
    6767                    if (exists($electronicalMailAddress)) then 
     68                        if (not (starts-with($electronicalMailAddress,"http"))) then 
    6869                        element gmd:electronicMailAddress { 
    6970                            element gco:CharacterString { data($electronicalMailAddress)} 
    7071                        } 
    7172                    else () 
    72                 } 
    73             } 
    74         } 
     73                  else () 
     74                } 
     75            },         
     76         
     77         (: Detect whether an email or a url has been passed - if a url then call appropriate CI_OnlineResourceFunction :) 
     78       if (exists($electronicalMailAddress)) then 
     79           if (starts-with($electronicalMailAddress,"http")) then 
     80               element gmd:onlineResource { 
     81                   isolib:CI_OnlineResource($electronicalMailAddress, "", "", "offlineAccess") 
     82               } 
     83           else () 
     84       else ()  
     85           
     86      
    7587    } 
     88   } 
    7689}; 
    7790 
     
    168181}; 
    169182 
    170 declare function isolib:transferOptions ($url as xs:string, $contentType as xs:string, $description as xs:string, $onlineFunctionCode as xs:string) 
     183declare function isolib:CI_OnlineResource ($url as xs:string, $contentType as xs:string, $description as xs:string, $onlineFunctionCode as xs:string) 
    171184(: 
    172 Function to generate gmd:MD_DigitalTranferOptions element structure 
    173 :) 
    174 { 
    175     element gmd:transferOptions { 
    176         element gmd:MD_DigitalTransferOptions { 
    177             (: note for now just using a single 1:1 mapping between dif related_url here :) 
    178             element gmd:onLine {  
    179                 element gmd:CI_OnlineResource { 
     185Function to generate a gmd:CI_OnlineResource element structure (note lifted from transferOptions so can reuse elsewhere!) 
     186:)  
     187{ 
     188    element gmd:CI_OnlineResource { 
    180189                    element gmd:linkage { 
    181190                        element gmd:URL { 
     
    201210                    } 
    202211                } 
     212 
     213}; 
     214 
     215declare function isolib:transferOptions ($url as xs:string, $contentType as xs:string, $description as xs:string, $onlineFunctionCode as xs:string) 
     216(: 
     217Function to generate gmd:MD_DigitalTranferOptions element structure 
     218:) 
     219{ 
     220    element gmd:transferOptions { 
     221        element gmd:MD_DigitalTransferOptions { 
     222            (: note for now just using a single 1:1 mapping between dif related_url here :) 
     223            element gmd:onLine {  
     224                isolib:CI_OnlineResource($url, $contentType, $description, $onlineFunctionCode) 
    203225            } 
    204226        } 
Note: See TracChangeset for help on using the changeset viewer.