If Zotero has a MarcXML translator, can't you just GIVE MarcXML to Zotero, and let it run it's own translator? You shouldn't need to run it's translator yourself somehow.
Xerxes deals in MarcXML already internally (at least for the Metalib part of Xerxes, that's what Metalib returns), so if there isn't some way to get MarcXML out now, we can easily add it. We could make &format=marcxml return the original marcxml the way &format=xerxes returns the Xerxes XML representation.
And then you can just let Zotero know about this somehow? We could even make Xerxes advertise it with a <link type="application/xml+marc"> tag (or whatever the 'best' content-type for marc-xml is.)
That would get you what you're thinking of doing with MarcXML and Zotero, right? No need to deal with "using an AJAX call" or manually using the Zotero MarcXML translator.
However, i suspect this (either way) won't get you as far as you think. Not all MarcXML is created equal. The Metalib-provided MarcXML is often idiosyncratic or odd. A lot of Xerxes work is already trying to deal with this and normalize it. But I don't think Xerxes normalization feeds back into new MarcXML neccesarily. I also suspect that Zotero's MarcXML translator is optimized for _book_ records (like from a catalog), and not _individual article_ records -- like in Metalib/Xerxes. It's unusual to put article records in MARC. You need to look in different parts of the marc record to get all the relevant citation details for an article that don't apply to a book (article title as well as journal title; volume, issue, page #, etc). I'd bet money Zotero isn't doing it. But you can investigate yourself.
I think it would be a better bet to _not_ use the raw MarcXML from Metalib, but piggyback on top of the normalization Xerxes is _already_ doing on top of the raw MarcXML to produce it's own human readable citations.
You just need to figure out _some_ format Zotero can take this. And it will not be hard to make Xerxes produce it, say at a URL that's the record page URL but with a "&format=something" on the end. It will still make data errors, but no more than it does currently for the human readable citations. That may or may not be good enough. You just need to get Zotero to know that when it's looking at a Xerxes item detail page, just add "&format=something" on the end to get the record detail in whatever 'something' format it wants. Something more complicated may be needed for search results pages. But it should _not_ have to include any "using an AJAX calls" or anything. Look at the code for Zotero unapi -- it will be something similar, but not based on unapi, but based on something else (perhaps microdata, I have thought this through and can tell you exactly how I think it should be done, or find my old email on this topic).
The first step is just figuring out what the heck format to give the data to Zotero in. I suspect MarcXML is not actually going to work well.
________________________________
From:
xerxes...@googlegroups.com [
xerxes...@googlegroups.com] on behalf of Scot [
scotd...@gmail.com]
Sent: Tuesday, May 08, 2012 7:52 PM
To:
xerxes...@googlegroups.com
Subject: Re: [xerxes-portal] Xerxes and Zotero
--
You received this message because you are subscribed to the Google Groups "xerxes-portal" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/xerxes-portal/-/11rg7Qq8_64J.