OSBib-Format

XML structure ~ Citation (In-text and Footnote style)

A collection of PHP classes to manage bibliographic formatting for OS bibliography software using the OSBib standard. Taken from and originally developed in WIKINDX (http://wikindx.sourceforge.net).

Released through http://bibliophile.sourceforge.net under the GPL licence.

If you make improvements, please consider contacting the administrators at bibliophile.sourceforge.net so that your improvements can be added to the release package.

May 2005
Mark Grimshaw (WIKINDX)
Andrea Rossato (Uniwakka)
Guillaume Gardey (BibOrb)
Christian Boulanger (Bibliograph)


INTRODUCTION
STRUCTURE


INTRODUCTION

Use BIBFORMAT::loadStyle() to load and parse the XML file into usable arrays. The XML file is logically divided into four areas, info (see bibliography_xml), citation (see below), styleCommon (see bibliography_xml) and styleTypes (see bibliography_xml).

The citation array, as returned by BIBFORMAT::loadStyle() and after being further parsed within CITEFORMAT will look something like:
Array ( [creatorStyle] => 0 [creatorOtherStyle] => 0 [creatorInitials] => 1 [creatorFirstName] => 1 [twoCreatorsSep] => & [creatorSepFirstBetween] => , [creatorListSubsequentAbbreviation] => et al. [creatorSepNextBetween] => , [creatorSepNextLast] => , & [creatorList] => 1 [creatorListMore] => 3 [creatorListLimit] => 1 [creatorListAbbreviation] => et al. [creatorUppercase] => on [creatorListSubsequentAbbreviationItalic] => on [creatorListAbbreviationItalic] => on [creatorListSubsequent] => 1 [creatorListSubsequentMore] => 3 [creatorListSubsequentLimit] => 1 [consecutiveCreator] => 1 [consecutiveCreatorSep] => , [template] => (|creator|%, %year|: pages|) [useInitials] => on [consecutiveCitationSep] => ; [yearFormat] => 2 [pageFormat] => 1 [templateSuperscript] => on [ambiguousName] => on [ambiguousMore] => on [ambiguousTitle] => on [ambiguousYear] => on [ibid] => ibid. [idem] => idem. [opCit] => op. cit. [ambiguousNameFormat] => 4 [ambiguousYearFormat] => 1 [footnotePagePosition] => 1 [footnotePageTemplate] => , pages [ibidPage] => on [footnoteStyle] => 0 [footnoteCitationPageFormat] => 2)

Not all elements need be present so you should always test with PHP's array_key_exists() function.

Because OSBib uses numeric indexing from 0 upwards, you should be careful to use something like:
if($citation['creatorListSubsequentLimit'] === FALSE)
...

to test for a FALSE value of an array element.


STRUCTURE

The description here relates to the various elements of the citation array. Each element will have either an INTEGER value or a STRING value.

In-text citation style:

Primary creators:
Primary creators are usually the author(s) of a resource but, depending on the type of resource, may be composers, inventors etc. etc. etc.

INTEGER creatorStyle Ordering and display of the name elements for the first of the primary creators.

INTEGER creatorOtherStyle Ordering and display of the name elements for the remaining primary creators.

	 0	=>	'Joe Bloggs'
	 1	=>	'Bloggs, Joe'
	 2	=>	'Bloggs Joe'
	 3	=>	Last name only

STRING useInitials If 'Last name only' is selected above, use initials to differentiate between creators with the same surname The value will be 'on' for yes otherwise the array element does not exist.

INTEGER creatorInitials Formatting of initials for the primary creators.

	 0	=>	'T. U. '
	 1	=>	'T.U.'
	 2	=>	'T U '
	 3	=>	'TU'

INTEGER creatorFirstName Formatting of first name for the primary creators.

	 0	=>	Print the full first name(s)
	 1	=>	Print initial(s) only

STRING twoCreatorsSep Separator in the case of just two primary creators.

STRING creatorSepFirstBetween Separator between the first two primary creators in the case where there are more than two.

STRING creatorSepNextBetween Separator between the following primary creators after the first two in the case where there are more than two.

STRING creatorSepNextLast Separator between the last two primary creators in the case where there are more than two.

STRING creatorUpperCase Uppercase/lowercase primary creator names. The value will be 'on' for yes otherwise the array element does not exist.

INTEGER creatorList Abbreviations for multiple primary creators.

	 0	=>	Print the full creator list
	 1	=>	Limit the creator list

INTEGER creatorListMore If more than this number of primary creators, format as per the limit defined here. Requires creatorList to be '1'.

INTEGER creatorListLimit Print only this number of primary creators if limit is exceeded as defined here. Requires creatorList to be '1'.

STRING creatorListAbbreviation If limit is exceeded as defined here, replace remaining primary creators with this string. Requires creatorList to be '1'.

STRING creatorListAbbreviationItalic Italicize creatorListAbbreviation. Requires creatorList to be '1'. The value will be 'on' for yes otherwise the array element does not exist.

INTEGER consecutiveCreator Consecutive and juxtaposed citations by the same primary creator(s).

	 0	=>	Print the creator list
	 1	=>	Do not print the creator list

STRING consecutiveCreatorSep String to separate consecutive and juxtaposed citations by the same primary creator(s) with if '1' is chosen for consecutiveCreator above. e.g. (Grimshaw, Gardey & Rossato 2005 p.32, 2001 pp.100-123).

Creator subsequent citations:
INTEGER creatorListSubsequent Abbreviations for multiple primary creators.
INTEGER creatorListSubsequentMore If more than this number of primary creators, format as per the limit defined here. Requires creatorListSubsequent to be '1'.
INTEGER creatorListSubsequentLimit Print only this number of primary creators if limit is exceeded as defined here. Requires creatorListSubsequent to be '1'.
STRING creatorListSubsequentAbbreviation If limit is exceeded as defined here, replace remaining primary creators with this string. Requires creatorListSubsequent to be '1'.
STRING creatorListSubsequentAbbreviationItalic Italicize creatorListSubsequentAbbreviation. Requires creatorListSubsequent to be '1'. The value will be 'on' for yes otherwise the array element does not exist.

Citations:
STRING template This is the template definition string such as (|creator|%, %year|: ^p.^pp.^ pages|).

STRING templateSuperscript Italicize template. The value will be 'on' for yes otherwise the array element does not exist. This would normally be used for integers in conjunction with footnote citation styles below.

STRING consecutiveCitationSep String to separate consecutive and juxtaposed citations with (Grimshaw, Gardey & Rossato 2005 p.32; Pozzi 2001 pp.100-123).

INTEGER pageFormat

	 0	=>	'132-9'
	 1	=>	'132-39'
	 2	=>	'132-139'

INTEGER yearFormat

	 0	=>	"1998"
	 1	=>	"'98"
	 2	=>	"98"

Ambiguous citations:
These should be processed in the order given here until the citation is no longer ambiguous.

STRING ambiguousName Use the full name or initials (as defined by ambiguousNameFormat below) of the primary creator(s) to disambiguate the citation. The value will be 'on' for yes otherwise the array element does not exist.

STRING ambiguousMore Use more of the primary creator(s) to disambiguate the citation. The value will be 'on' for yes otherwise the array element does not exist.

STRING ambiguousTitle Use the resource title to disambiguate the citation. The value will be 'on' for yes otherwise the array element does not exist.

STRING ambiguousYear Add a lowercase letter after the publication year (as defined by ambiguousYearFormat below) to disambiguate the citation. The value will be 'on' for yes otherwise the array element does not exist.

INTEGER ambiguousNameFormat

	 0	=>	"Full name",
	 1	=>	'T. U. '
	 2	=>	'T.U.'
	 3	=>	'T U '
	 4	=>	'TU'

INTEGER ambiguousYearFormat

	 0	=>	"Full name"
	 1	=>	'1999a, b'
	 2	=>	'1999a, 1999b'

Footnote citation style:

For footnote style citations, OSBib will format the citation as for bibliographic lists with the addition of page numbers. For articles that are part of a collection and that would normally display the complete page range of the article, this page range will be removed leaving just the citation page(s).

INTEGER footnoteStyle How to format the citation.

	 0	=>	"Format like bibliography"
	 1	=>	"Format like in-text citation"

STRING ibid Replace consecutive citations for the same resource and the same page with this string.

STRING ibidPage If a string is given for ibid above, print the citation page number(s) as well if footnoteCitationPageFormat below is not 0. If no string is given, the full citation should be printed. The value will be 'on' for yes otherwise the array element does not exist.

STRING idem Replace consecutive citations for the same resource but a different page with this string. If no string is given, the behaviour should follow that of ibid and ibidPage above.

STRING opCit Replace previously cited resources with this string. If no string is given, the behaviour should follow that of ibid and ibidPage above.

INTEGER footnoteCitationPageFormat If 1 is chosen, the pages' field in the bibliographic templates for each type of resource should be used for the citation page(s).

	 0	=>	"Never print citation page(s)"
	 1	=>	"Same as the bibliographic templates"
	 2	=>	"Use the template below"

STRING footnotePageTemplate This is the template definition string such as , ^p.^pp.^ pages for the page number(s) if 2 is chosen for footnoteCitationPageFormat above.

INTEGER footnotePagePosition

	 0	=>	"Before citation"
	 1	=>	"After citation"