[Net-z3950] elementSet and XML record syntax

Mike Taylor mike at indexdata.com
Thu Jun 17 14:17:58 CEST 2004

> Date: Thu, 17 Jun 2004 13:55:43 +0200 (CEST)
> From: Sigfrid Lundberg <sigfrid.lundberg at lub.lu.se>
> I was searching a TKL database (actually I was trying to debug it),
> and to that end I wanted to retrieve its content from a perl program
> and make some analyses. And there is no way to tell Zebra to use
> element set 'f' for its 'link', 'news', 'document' kind of
> records. So I just want to be able to switch of that altogether
> (there does not seem to be a need for that in php-yaz.

A request that doesn't specify an element-set name at all?  I guess
you're right that the Perl module ought to be able to send that, but
it would be strange if that were really what Zebra requires.  (I had
to check the standard before I was even confident that this is legal!)

> This is interesting, what an element set should mean in a system
> using XML record syntax. I think it has been discussed in the
> ZIG-list once.

I don't think it's at all possible to give a one-size-fits-all answer.
It's entirely dependent on the profile.

> One far too simplistic way of thinking would be to return marc 21
> XML if element set is 'f' and bath dtd XML if it's 'b' ;-)

Far too simplistic, indeed!  I think this would be be contrary to the
letter of the Z39.50 standard, and certain to its spirit!

> I'd love to see a server that would accept a piece of xslt rather
> than 'B's or 'F's. Then I could taylor my retrieved object server
> side and avoid transmitting things I'll throw in the bin
> anyway. Would be faster to do this server side, and the xslt could
> be made indivudually for each query. I'd love that myself (but
> wouldn't love to open this facility on my server for just any one
> out there).

Exactly.  This has been discussed on the ZIG list (with I don't
remember what result), and the facility has been added -- over some
protests, notably from Matthew Dovey -- to the SRW 1.1
specifications.  The general feeling is that it's a wonderfully
powerful facility but that "with power comes great responsibility",
and that it's a wide-open gateway by which hostile clients can attempt
various attacks -- notably denial of service simply by sending
computationally intensive XPath expressions.

> > What exactly do you think the Net::Z3950 moduile should be doing about
> > this?
> Behave more like php-yaz in that it doesn't ask for any specific
> element set unless told to do so.
> $rs->option("elementSetName" => undef);
> print $rs->option("elementSetName");
> prints a 'B', and will ask for brief records, which Zebra cannot
> provide in the database I've got.

Hah!  That's funny.  Yes, it's a consequence of the way the modules
uses an undefined value to mean "No value set at this level".  The
result is that the module-wide default gets used.  Tricky one.  Have
you tried using a zero-length string?

 _/|_	 _______________________________________________________________
/o ) \/  Mike Taylor  <mike at indexdata.com>  http://www.miketaylor.org.uk
)_v__/\  4GLs are nothing new: "sed" has been around for decades.

Listen to free demos of soundtrack music for film, TV and radio

More information about the Net-z3950 mailing list