Hello Jason,

Did you find a good solution for the problem?

When looking at the source of FedoraOAIDriver I came across this code:

             if ((dissURI.split("/").length == 3) && 
(dissURI.endsWith("/DC"))) {
                 // If it's a DC datastream dissemination, inject the
                 // xsi:schemaLocation attribute
                 xml =
                         xml.replaceAll("<oai_dc:dc ", "<oai_dc:dc "
                                 + _XSI_DECLARATION + " " + 
_DC_SCHEMALOCATION
                                 + " ");
             }

It just adds the XSI declaration, regardless if its in there or not, but 
only for DC.

I changed the code to:

                        if (dissURI.split("/").length == 3 && 
dissURI.endsWith("/DC") && 
!xml.contains(_XSI_DECLARATION)) {
                                // If it's a DC datastream dissemination, 
inject the
                                // xsi:schemaLocation attribute
                                xml = xml.replaceAll("<oai_dc:dc ", "<oai_dc:dc 
" + _XSI_DECLARATION 
+ " " + _DC_SCHEMALOCATION + " ");
                        }


And now it works correctly (for our setup)


Regards,

Martin


Jason Nugent wrote:
> To update my own post, yes there appears to be an issue.  If I remove
> the xsi namespace declaration and the schemaLocation, my DC datastream
> is correctly indexed by PROAI and included in the ListRecords verb when
> the oai_dc stream is specified:
> 
> http://etc.hil.unb.ca:8080/oaiprovider/?verb=ListRecords&metadataPrefix=oai_dc
> 
> The submitted datastream is now this:
> 
> http://etc.hil.unb.ca:8080/fedora/get/test:oaiprovider-object-item-c.d_a.n/DC
> 
> Most interesting.
> 
> Jason
> 
> On 8/12/09 11:48 AM, Jason Nugent wrote:
>> Hello, everyone,
>>
>> While tinkering with the OAI harvester, I may have stumbled across a bug
>>  in the PROAI component.  To trigger updates in the OAI, I was making
>> changes to the DC datastream.  It seems as though some name spaces are
>> being declared more than once, and the changes are being accepted.  I
>> only noticed this because I have my log level set to DEBUG on the proai
>> side of things.
>>
>> In the editor, my datastream was submitted as:
>>
>> <oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/";
>> xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/";
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/
>> http://www.openarchives.org/OAI/2.0/oai_dc.xsd";>
>>
>>  ... data
>>
>> </oai_dc:dc>
>>
>> But PROAI reported it as this:  (and generated a SAX Exception in the
>> process)
>>
>> <oai_dc:dc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/
>> http://www.openarchives.org/OAI/2.0/oai_dc.xsd";
>> xmlns:dc="http://purl.org/dc/elements/1.1/";
>> xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/";
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/
>> http://www.openarchives.org/OAI/2.0/oai_dc.xsd";>
>>
>>  .... data
>>
>> </oai_dc:dc>
>>
>>  Notice that in the submitted version, the xmlns:xsi namespace is
>> declared twice, as is the xsi schemeLocation.
>>
>> If I access the object's DC stream directly, via the following URL:
>>
>> http://etc.hil.unb.ca:8080/fedora/get/test:oaiprovider-object-item-c.d_a.n/DC
>>
>> You can see that the name spaces are not declared twice.
>>
>> Cheers,
>>
>> Jason
> 


-- 
Martin Tilma
Func. Internet Integration
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Fedora-commons-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fedora-commons-users

Reply via email to