source: exist/trunk/xquery/atom2DC.xq @ 4424

Subversion URL:
Revision 4424, 1.4 KB checked in by cbyrom, 12 years ago (diff)

Only put actual dataent ID into DC produced by atom2DC transform + fix
transform variable names.

1(: Create a dublin core document from Atom documents in TargetCollection which have LocalID :)
2import module namespace voclib='' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery';
3import module namespace utillib='' at 'xmldb:exist:///db/xqueryLib/Utilities/utility_xquery_lib.xquery';
5declare default element namespace '';
6declare namespace xsi='';
7declare namespace dc='';
8declare namespace oai_dc='';
9declare namespace moles="";
11declare variable $targetCollection as xs:string := 'TargetCollection';
12declare variable $localIdentifier as xs:string := 'LocalID';
14for $DE in collection($targetCollection)/entry[matches(id, concat('__ATOM__',$localIdentifier,'$'))]
16element oai_dc:dc {
17    attribute xsi:schemaLocation {''},
18    element dc:title {string($DE/title)},
19    element dc:type {'Dataset'},
20    element dc:identifier {tokenize(string($DE/id), '__ATOM__')[2]},
21    element dc:description {string($DE/summary)},
22    element dc:date {string($DE/updated)},
23    element dc:creator {string($DE/author/name)},
24    element dc:publisher {string($DE/moles:entity/moles:molesISO/moles:providerID)}
Note: See TracBrowser for help on using the repository browser.