I'm working on generating links for 7XX linking fields in XSLT, a-la Bug 15140 - Add MARC21 776 to OPAC and staff display (https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15140).
This Takes the 773$w, and uses the XSLT template 'extractControlNumber' which strips the leading MARCOrgCode, e.g. turning
(OCoLC)2776588 into 2776588 ... and then the search URL is
In short: 0-8 digits: 0 pad to 8 digits, prepend 'ocm':
2776588 -> ocm02776588
9 digits, prepend 'ocn'
> 9 digits, prepend 'on'
I tried formatting the search with a leading '*':
as well as with leading and trailing '*'
Neither of these worked.
Formatting the control number according to the OCLC rules above did work:
So I have three questions:
1) Is there a way to format a Control-number search that doesn't force me to generate the control number according to the OCLC rules above?
2) If not, does anyone have pointers about how to
* Test for (OCoLC) ->
* Test length of control number
* < 9 -> 0 pad to 8 digits, prepend 'ocm'
* 9 -> prepend 'ocn'
* > 9 -> prepen 'on'
3) Are there other control number formatting rules for other MARCOrgCodes?