#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 jcaffaro):
The limitation is mostly due to the support of extension functions in
BibFormat XSL:
http://invenio-demo.cern.ch/help/admin/bibformat-admin-
guide#xslFormatTemplate
'''fn:modification_date(recID)'''
'''fn:creation_date(recID)'''
'''fn:eval_bibformat(recID, bibformat_template_code)'''
The first two functions need the recid to retrieve this information in an
XSL context. The function could be extended to a) not fail if no recID is
given and/or b) retrieve this information from baskets if possible (did
they use to have something like negative "recid"?). Sometimes not having
this information would anyway not make sense and would produce invalid
output (eg. RSS output and its {{{<pubDate>}}} tag)
The last function which lets run any BibFormat template/element in XSL
templates is a bit more tricky to fix. Though the recid is just used to
instantiate a BibFormatObject (bfo) which could very well be instantiated
with an XML snippet too, it ''might'' be impossible to access the
currently processed XML from the eval_bibformat(..) function.
If not possible, one could add a new "marcxml" parameter to the function,
which could be provided from the template itself:
fn:eval_bibformat(recID, bibformat_template_code, '''marcxml''')
{{{
<xsl:value-of
select="fn:eval_bibformat(marc:controlfield[@tag='001'],'<BFE_SERVER_INFO
var="recurl">',marc:.)" />
}}}
This might have some impact on speed though, and might not be possible in
all cases.
Other alternatives, which can be combined:
1. whenever an XSL template is processed without a recid, do not process
the above extension functions.
2. Introduce a new type of extension function which does not rely on
recid, nor marcxml, which could be used to process data more easily than
in XSL (eg. date formatting)
3. Update the current XSL templates to not use extension functions.
4. Move back to bfx templates...
--
Ticket URL: <http://invenio-software.org/ticket/251#comment:2>
Invenio <http://invenio-software.org>