Ignore:
Timestamp:
15/10/08 12:27:18 (11 years ago)
Author:
sdonegan
Message:

Updated these dif2moles2dif conversions to not use encoded URIS as not needed in non-Exist installation??

File:
1 edited

Legend:

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

    r4337 r4338  
    2020declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance';  
    2121 
    22 (: Replacable parameters :) 
     22(: Replacable parameters:)  
    2323declare variable $targetCollection as xs:string := 'TargetCollection'; 
    2424declare variable $input_repository as xs:string := 'RepositoryID'; 
     
    2727declare variable $output_local_id as xs:string := 'LocalID'; 
    2828 
     29 
     30(:declare variable $input_entry_id as xs:string := 'badc.nerc.ac.uk:DIF:dataent_ukmo-midas'; 
     31declare variable $targetCollection := doc("badc.nerc.ac.uk__DIF__dataent_ukmo-midas.xml";:) 
     32 
     33 
    2934(: SJD get current date and manipulate to correct format as raw current-date not useable in MOLES:) 
    3035declare variable $currentDate as xs:string := substring(current-date() cast as xs:string,1,10); 
    3136(:declare variable $extractDate as xs:string := substring($fullDate,1,10);:) 
    3237 
    33 (:for $DIF in collection(collection($targetCollection))/dif:DIF[dif:Entry_ID=$input_entry_id]:) 
     38(:for $DIF in collection($targetCollection)/dif:DIF[dif:Entry_ID=$input_entry_id]:) 
    3439for $DIF in collection($targetCollection)/dif:DIF[dif:Entry_ID=$input_entry_id] 
    3540return 
     
    6772                if (exists($descOnline/dif:Description)) then  
    6873                    element name {data($descOnline/dif:Description)}, 
    69                     element URL {encode-for-uri(data($descOnline/dif:URL))} 
     74                    element URL {data($descOnline/dif:URL) cast as xs:anyURI} 
    7075                else 
    7176                    element name {data('URL')} 
     
    375380                element name {string($creator)}, 
    376381                element abbreviation {string($creator)}, 
    377                 element contactDetails {''} 
     382                element contactDetails {   
     383                    element URI {data($DIF/dif:Data_Center/dif:Data_Center_URL)} 
     384                } 
    378385        } 
    379386 else 
     
    389396                element name {data($DIF/dif:Data_Center/dif:Data_Center_Name/dif:Long_Name)}, 
    390397                element abbreviation {data($DIF/dif:Data_Center/dif:Data_Center_Name/dif:Short_Name)}, 
    391                 element contactDetails {''} 
     398                element contactDetails {   
     399                    element URI {data($DIF/dif:Data_Center/dif:Data_Center_URL) cast as xs:anyURI} 
     400                } 
    392401     } 
    393402  
Note: See TracChangeset for help on using the changeset viewer.