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

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

Add new xquery for producing dublin core docs from atoms.

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 := '/db/atoms/published/data_entities/';
12declare variable $localIdentifier as xs:string := 'dataent_URGENT';
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 {string($DE/id)},
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.