[Yazlist] yaz, XML and III's Z39.50 server

Godmar Back godmar at gmail.com
Fri Dec 16 02:22:26 CET 2005


I think I understand what you want me to do. Just to be sure - if I do this:

                $rec = yaz_record($id[$i],$p,"syntax");
                if (strcasecmp($rec, "opac") == 0) {
                    // yaz translates this into fine XML.
                    $rec = yaz_record($id[$i],$p,"opac; charset=marc-8, utf-8");
                    echo "\n" . $rec . "\n";
                }

you'll guarantee that the second yaz_record() will not output any
warnings or errors into the XML that's being output?

I tried the code above and it indeed handles the case that previously
output the warning - the record type was USmarc in that case, even
though I had specified 1.2.840.10003.5.102 in yaz_syntax - apparently,
Z39.50 servers have the freedom to return records in a different
format (?) than the one requested.

Thanks!

 - Godmar

On 12/15/05, Sebastian Hammer <quinn at indexdata.com> wrote:
> Godmar Back wrote:
>
> >On 12/15/05, Sebastian Hammer <quinn at indexdata.dk> wrote:
> >
> >
> >>Btw, you can suppress the diagnostic output with the @ operator in the
> >>function call. You can also use the 'type' argument to yaz_record to
> >>determine the type of record before you pull it out.
> >>
> >>
> >>
> >
> >What is the @operator, how would I use it, and for which function
> >call?  The call to yaz_record?
> >
> >How would I use the 'type' argument to yaz_record to determine the
> >type of the record without pulling it out? How is the type of the
> >record related to my problem?
> >
> >
> Sorry, I was too quick on the keyboard there. I meant you can use
> type='syntax' to ask about the record syntax returned by the server
> before making a decision about how to display it. In your case, I'd say
> that's probably the smartest approach.
>
> >In my case, a record was retrieved using the OPAC schema, but the
> >record didn't have the required holdings information which made your
> >conversion routine fail.  In your proposal, would that record then be
> >flagged with a different type?  If so, what is the type of "OPAC"
> >records that don't have holdings information and how would I use
> >yaz_record to find out?
> >
> >
> It depends. If the server actually returns those records for electronic
> items in MARC, then you can just display those records as normal.. if
> the server doesn't return them at all, then you need more clever logic
> to go back and ask for those records in a different syntax.
>
> Many ILS's are built on the assumption that you will first display the
> records in MARC, then go back and ask for OPAC information if it's the
> right kind of resource, and if the user is interested... indeed, for
> some systems, the circulation status lookup is more expensive than
> simple retrieval of a bibliographic record... of course, many modern
> user interfaces would like to flag circulation status much earlier --
> all the way out in the brief record display.
>
> Sometimes, programmers have to be cunning.
>
> --Sebastian
>
> >
> >
> >>After having talked to Adam about this, I retract my comment about the
> >>behavior of yaz_record bing a bug. It is, in fact, a feature.
> >>
> >>
> >>
> >
> >You mentioned earlier that you don't have a DTD yet for the XML you're creating.
> >Consider what such a DTD would have to look like if you allowed XML such as
> >
> ><br />
> ><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>72</b><br />
> >
> >in it.
> >
> >I'd like to reiterate my argument that error messages with ambiguous
> >content are not helpful to the developer.
> >
> > - Godmar
> >
> >
> >
> >>Happy coding,
> >>
> >>--Sebastian
> >>
> >>
> >>
> >>
> >>
> >>>/ 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
> >>>http://www.indexdata.dk/mailman/listinfo/yazlist
> >>>
> >>>
> >>>
> >>--
> >>Sebastian Hammer, Index Data
> >>quinn at indexdata.com   www.indexdata.com
> >>Ph: (603) 209-6853
> >>
> >>
> >>
> >>_______________________________________________
> >>Yazlist mailing list
> >>Yazlist at indexdata.dk
> >>http://www.indexdata.dk/mailman/listinfo/yazlist
> >>
> >>
> >>
> >
> >
> >_______________________________________________
> >Yazlist mailing list
> >Yazlist at indexdata.dk
> >http://www.indexdata.dk/mailman/listinfo/yazlist
> >
> >
> >
>
> --
> Sebastian Hammer, Index Data
> quinn at indexdata.com   www.indexdata.com
> Ph: (603) 209-6853
>
>
>
>
>
> _______________________________________________
> Yazlist mailing list
> Yazlist at indexdata.dk
> http://www.indexdata.dk/mailman/listinfo/yazlist
>





More information about the Yazlist mailing list