[Yazlist] yaz, XML and III's Z39.50 server
godmar at gmail.com
Thu Dec 15 17:35:00 CET 2005
I would tend to agree with Sebastian here (have yaz_record return
null, set error code.)
For one, I don't like to have to parse the string returned by
yaz_record to identify this situation; and second, the warning message
you currently give is very ambiguous (bad record type ... or unable to
return record - well which one is it?)
On 12/15/05, Adam Dickmeiss <adam at indexdata.dk> wrote:
> Sebastian Hammer wrote:
> > Godmar Back wrote:
> >> On 12/15/05, Sebastian Hammer <quinn at indexdata.com> wrote:
> >>> Try passing the string 'opac' to yaz_record instead.
> >> Wonderful.
> >> Passing 'opac' does indeed show the holdings information using an XML
> >> for which I wasn't able to find the DTD or Schema online (it uses
> >> opacRecord, bibliographicRecord, etc. as its elements.) Although I was
> >> unable to find the DTD online, I figured out that this appears to be
> >> documented as something called 7Z39.50 OPAC Record Syntax Elements
> >> (see
> >> http://www.unt.edu/xmlholdings/Resources/OpacRecordSyntax17Oct2004.pdf
> >> ).
> > It's a homegrown schema, but the contents should be pretty obvious...
> > for now, you'll need to consult the source code if you need more
> > documentation than that. Sorry about that. Usually the most broadly
> > interesting features get documented first. :-)
> >> This leads to two follow-up questions.
> >> First, regarding standards. These Z39.50 OPAC Record Syntax Elements
> >> were removed from Z39.50 in 2003 and replaced with the "Z39.50
> >> Holdings Schema". Apparently III's server still supports these
> >> deprecated elements.
> >> How would I instruct the server to use the new Holdings Schema using
> >> the yaz tools?
> > I don't know if III supports the new schema, but normally, you would
> > specify XML as a record syntax, and specify some name or other in the
> > elementSetName to tell the server what type of information you're
> > interested in. It might be best to ask III what, if anything, they're
> > capable of supporting.
> >> Second, although these OPAC Record Syntax Elements work for most
> >> records, they don't work for some.
> >> For instance, this record: http://addison.vt.edu/search/i?0618153632
> >> when viewed via yaz-client, does not include those additional holdings
> >> fields (publicNote, localLocation etc.). This may be because it's an
> >> electronic resource and the cataloger entered non-compliant
> >> information (not being a librarian, I wouldn't know whom to blame,
> >> but:)
> >> yaz_record("opac"), instead of signaling an error, creates this XML:
> >> ------ XML created by yaz_record() when record is missing holdings
> >> fields ------
> >> <b>Warning</b>: yaz_record(): Bad yaz_record type opac; marc-8, utf-8
> >> - or unable to return record with type given in
> >> <b>/Library/WebServer/libx.org/libx/src/editions/z3950.php</b> on line
> >> <b>60</b><br />
> >> -----------------
> >> shouldn't yaz_error() or yaz_record() instead return an error?
> >> (I wonder if you've designed yourself in a corner here since yaz_error
> >> doesn't know what format yaz_record will use, and yaz_record has no
> >> way to signal an error other than throwing an exception - if php
> >> supports exceptions(?))
> > Don't think there are any corners here.. seems to me that yaz_record()
> > should return null and set the error code on the session in this
> > situation. If what you say is correct, I'd argue that you've just
> > stumbled on a bug, nothing else.
> The warning is new code and was produced for a purpose.. People gets
> very confused when they just get an empty string.. What does it mean?
> That the server returns an empty record.. They coded things wrong or..
> But if people rather would like empty strings for Exception like
> situations we can reverse.. It is a pure client-side error.. The
> structure can not be returned .. possibly the server did not return OPAC
> at all or the structure was not understandable by PHP/YAZ.
> / Adam
> > --Sebastian
> >> Thanks!
> >> - Godmar
> >> _______________________________________________
> >> Yazlist mailing list
> >> Yazlist at indexdata.dk
> >> http://www.indexdata.dk/mailman/listinfo/yazlist
> Yazlist mailing list
> Yazlist at indexdata.dk
More information about the Yazlist