Changeset 4673 for exist


Ignore:
Timestamp:
17/12/08 15:08:15 (11 years ago)
Author:
sdonegan
Message:

Removed cast as dates as actual mdip date contents ropey! Validation at ingest should ultimately sort this out.

File:
1 edited

Legend:

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

    r4124 r4673  
    88declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance';  
    99 
    10 (:declare variable $targetCollection as xs:string := '.';:) 
     10(:declare variable collection($targetCollection) := doc("mdip2moles_OP.xml");:) 
     11 
    1112declare variable $targetCollection as xs:string := 'TargetCollection'; 
    1213declare variable $repositoryIdentifier as xs:string := 'RepositoryID'; 
    13 declare variable $localIdentifier as xs:string := 'LocalID'; 
     14declare variable $localIdentifier as xs:string := 'BGSSEA412'; 
     15 
    1416declare variable $ISO_639-2_ns as xs:string := $voclib:ISO_639-2_ns; 
    1517declare variable $ISO_3166_ns as xs:string := $voclib:ISO_3166_ns; 
     
    2123    and moles:dgMetadataID/moles:localIdentifier=$localIdentifier] 
    2224return 
    23 element Metadata { 
    24     attribute xsi:schemaLocation {'http://www.oceannet.org/mdip/xml N:\DATAMA~1\METADA~2\MDIP\MDIP_Metadata_v1_3.xsd'}, (:remove for production :) 
     25element Metadata {    
    2526    element Title {data($DE/moles:name)}, 
    2627 
     
    112113             if ($DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange/moles:DateRangeStart) != '') then 
    113114                element DatasetStartDate { 
    114                     let $dateStart:=min($DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange/moles:DateRangeStart) cast as xs:date) 
     115                    let $dateStart:=min($DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange/moles:DateRangeStart)) 
    115116                    return  
    116117                        if (empty($dateStart)) then ()  
     
    122123            if ($DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange/moles:DateRangeEnd) != '') then 
    123124                element DatasetEndDate{ 
    124                   let $dateEnd:=max($DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange/moles:DateRangeEnd) cast as xs:date) 
     125                  let $dateEnd:=max($DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange/moles:DateRangeEnd)) 
    125126                  return 
    126127                    if (empty($dateEnd)) then ()  
     
    137138         if ($DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange[1]/moles:DateRangeStart) != '') then 
    138139            element DatasetStartDate { 
    139                     let $dateStart:=$DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange[1]/moles:DateRangeStart) cast as xs:date 
     140                    let $dateStart:=$DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange[1]/moles:DateRangeStart) 
    140141                    return  
    141142                        if (empty($dateStart)) then ()  
     
    146147             if ($DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange[count($DE//moles:dgTemporalCoverage/moles:DateRange)]/moles:DateRangeEnd) != '') then 
    147148                element DatasetEndDate { 
    148                     let $dateEnd:=$DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange[count($DE//moles:dgTemporalCoverage/moles:DateRange)]/moles:DateRangeEnd) cast as xs:date 
     149                    let $dateEnd:=$DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange[count($DE//moles:dgTemporalCoverage/moles:DateRange)]/moles:DateRangeEnd) 
    149150                    return 
    150151                        if (empty($dateEnd)) then ()  
Note: See TracChangeset for help on using the changeset viewer.