#251: BibFormat: problems with format_record() and live incomplete MARCXML
------------------------+---------------------------------------------------
Reporter: simko | Owner:
Type: defect | Status: new
Priority: critical | Milestone: v1.0
Component: BibFormat | Version:
Resolution: | Keywords:
------------------------+---------------------------------------------------
Comment (by simko):
More info for clarification. While MARC standard seems to suggest 001
is mandatory, the MARCXML schema seems to allow not having one. Which
is suitable for records not living as records, but as MARCXML
snippets. So we have either to be prepared for those, or we should
require passing fake record ID like 0.
In any case, EndNote and some other output formats currently ignore
MARCXML snippet that is being passed via `xml_record` argument to
`format_record()`, but seem to rely solely on getting the information
via recID, which cannot work for snippet-only records such as external
basket items. Example:
{{{
In [20]: z = "foo bar blah"
In [21]: format_record(1, 'xe', xml_record=z, on_the_fly=True)
Out[22]: '<abbr class="unapi-id" title="1"></abbr>\n<strong>ALEPH
experiment: Candidate of Higgs boson production</strong> / <a
href="http://pcuds33.cern.ch/search?ln=en&p=Photolab&f=author">Photolab</a>;
14 06 2000.<br /><small>Candidate for the associated production of the
Higgs boson and Z boson. [...]</small><br /><small class="note"><a
class="note"
href="http://pcuds33.cern.ch/record/1/files/0106015_01.jpg">http://pcuds33.cern.ch/record/1/files/0106015_01.jpg</a></small><br
/><small class="note"><a class="note"
href="http://pcuds33.cern.ch/record/1/files/0106015_01.gif?subformat=icon">http://pcuds33.cern.ch/record/1/files/0106015_01.gif?subformat=icon</a></small>'
In [23]: format_record(2, 'xe', xml_record=z, on_the_fly=True)
Out[23]: '<abbr class="unapi-id" title="2"></abbr>\n<strong>The first
CERN-built module of the barrel section of ATLAS\'s electromagnetic
calorimeter</strong> / <a
href="http://pcuds33.cern.ch/search?ln=en&p=Patrice+Lo%C3%AFez&f=author">Patrice
Lo\xc3\xafez</a>; 10 Apr 2001.<br /><small>Behind the module, left to
right Ralf Huber, Andreas Bies and Jorgen Beck Hansen. [...]</small><br
/><small class="note"><a class="note"
href="http://pcuds33.cern.ch/record/2/files/0104007_02.jpeg">http://pcuds33.cern.ch/record/2/files/0104007_02.jpeg</a></small><br
/><small class="note"><a class="note"
href="http://pcuds33.cern.ch/record/2/files/0104007_02.gif?subformat=icon">http://pcuds33.cern.ch/record/2/files/0104007_02.gif?subformat=icon</a></small>'
}}}
--
Ticket URL: <http://invenio-software.org/ticket/251#comment:1>
Invenio <http://invenio-software.org>