[XML4Lib] Namespaces in SRU

Eric Lease Morgan emorgan at nd.edu
Fri Nov 11 08:38:07 EST 2005

On Nov 11, 2005, at 6:53 AM, Jakob Voss wrote:

> In february there was a short discussion about namespaces. I'm  
> fighting with PICA implementation of SRU because they just skipped  
> the namespaces so all your XSLT and XPath does not work:
> See http://greta.pica.nl:1080/sru/
> <?xml version="1.0" encoding="iso-8859-1" ?>
> <explain id="OCLC PICA Test" authoritative="true">
>   <serverInfo protocol="sru" version="1.0">
>     <host>greta.pica.nl</host>
>     <port>1080</port>
>     <database>/sru/</database>
>   </serverInfo>
>   <!-- ... -->
> </explain>
> Compared to http://alert.ockham.org/sru-server.cgi
> <?xml version="1.0"?>
> <explainResponse xmlns="http://www.loc.gov/zing/srw/">
>   <version>1.1</version>
>   <record>
>     <recordSchema>http://explain.z3950.org/dtd/2.0/</recordSchema>
>     <recordPacking>xml</recordPacking>
>     <recordData>
>       <explain xmlns="http://explain.z3950.org/dtd/2.0/">
>         <serverInfo protocol='SRU' version='1.1'>
>           <host>alert.ockham.org</host>
>           <port>80</port>
>           <database>sru-server.cgi</database>
>         </serverInfo>
>       </explain>
> ...
> </explainResponse>
> I wonder if this is just a difference between SRU 1.0 and SRU 1.1.
> Are namespaces mandatory in SRU 1.1? Can you just skip the  
> "explainResponse" envelope?
> BTW: I would appreciate a better readable standard like W3C  
> recommendations or the OAI-MPH specification. A single PDF file
> (http://srw.cheshire3.org/SRW-1.1.pdf) is not that comfortable.

Jakob, yes, namespaces are mandatory in SRU 1.1, but based on my  
knowledge how they are declared is not standardized. I have found  
this to be one of the challenges to writing XSLT stylesheets against  
SRU responses.

Regarding the specification, this too has been a sticking point, but  
I also believe the specification is in the process of being re- 
formatted for better readability.

Finally, I am CC'ing the SRU mailing list on my reply. Others there  
will be able to provide more authoritative answers to your questions,  
and possibly point you to the re-formatted specification as well as a  
conformance testing tool allowing you to validate yours and other's  
SRU responses.

Eric Lease Morgan
University Libraries of Notre Dame

More information about the XML4Lib mailing list