source: ndgCommon/trunk/ndg/common/xmldb/xquery/DIF2DC.xq @ 5611

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/ndgCommon/trunk/ndg/common/xmldb/xquery/DIF2DC.xq@5611
Revision 5611, 911 bytes checked in by sdonegan, 10 years ago (diff)

Got rid of problem character

Line 
1(:Return a specific DC document converting from the DIF present:)
2declare default element namespace 'http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/';
3
4declare namespace dc='http://purl.org/dc/elements/1.1/';
5declare namespace oai_dc='http://www.openarchives.org/OAI/2.0/oai_dc/';
6declare variable $targetCollection as xs:string := 'TargetCollection';
7declare variable $localIdentifier as xs:string := 'RepositoryID:DIF:LocalID';
8
9for $DE in collection($targetCollection)/DIF[Entry_ID=$localIdentifier] return
10
11element oai_dc:dc {
12    attribute xsi:schemaLocation {'http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd'},
13    element dc:title {data($DE/Entry_Title)},
14    element dc:type {'dataset'},
15    element dc:identifier {replace(data($DE/Entry_ID),":DIF:","__DC__")},
16    element dc:description {data($DE/Summary)},
17    element dc:date {data($DE/DIF_Revision_History)}
18}
Note: See TracBrowser for help on using the repository browser.