1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2"http://www.w3.org/TR/html4/loose.dtd">
3<html>
4<head>
5<title>OSBib-Format</title>
6<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7<style type="text/css">
8<!--
9.style3 {color: #00CC00}
10.style9 {color: #CC00FF}
11.style11 {color: #FF0000}
12.style13 {color: #FF00FF}
13-->
14</style>
15</head>
16
17<body>
18<h1>OSBib-Format</h1>
19<h3>XML structure ~ Bibliography</h3>
20<p> A collection of PHP classes to manage bibliographic formatting for OS bibliography software
21using the OSBib standard. Taken from and originally developed in WIKINDX (<a href="http://wikindx.sourceforge.net">http://wikindx.sourceforge.net</a>). </p>
22<p>Released through <a href="http://bibliophile.sourceforge.net">http://bibliophile.sourceforge.net</a> under the GPL licence.</p>
23<p>If you make improvements, please consider contacting the administrators at <a href="http://bibliophile.sourceforge.net">bibliophile.sourceforge.net</a> so that your improvements can be added to the release package.</p>
24<p><em>May 2005<br>
25  </em>Mark Grimshaw (<a href="http://wikindx.sourceforge.net">WIKINDX</a>)<br>
26  Andrea Rossato (<a href="http://uniwakka.sourceforge.net/HomePage">Uniwakka</a>)<br>
27  Guillaume Gardey (<a href="http://biborb.glymn.net/doku.php">BibOrb</a>)<br>
28Christian Boulanger (<a href="http://bibliograph.panya.de/">Bibliograph</a>)</p>
29<hr>
30<p><a href="#introduction">INTRODUCTION</a><br>
31<a href="#structure">STRUCTURE</a></p>
32<hr>
33<h3><a name="introduction"></a>INTRODUCTION</h3>
34<p>Use <span class="style3"><code><a href="osbib.html#bibformatLoadstyle">BIBFORMAT::loadStyle()</a> </code></span>to load and parse the XML file into usable arrays. The XML file is logically divided into four areas, <em>info</em> (general information about the formatting style), <em>citation</em> (see <a href="citation_xml.html">citation_xml</a>), <em>styleCommon</em> (common styling for bibliographic lists) and <em>styleTypes</em> (specific formatting depending on the type of resource).</p>
35<p>The <em>info </em>array as returned by <span class="style3"><code><a href="osbib.html#bibformatLoadstyle">BIBFORMAT::loadStyle()</a></code></span> will look something like:<br>
36    <code><span class="style9">Array ( [name] =&gt; APA [description] =&gt; American Psychological Association (APA) [language] =&gt; English [version] =&gt; 1.0 )</span></code></p>
37<p>The <em>styleCommon</em> array, as returned by <span class="style3"><code><a href="osbib.html#bibformatLoadstyle">BIBFORMAT::loadStyle()</a></code></span> and after being further parsed by <span class="style3"><code><a href="osbib.html#bibformatGetstyle">BIBFORMAT::getStyle()</a></code></span> will look something like:<br>
38    <code class="style9">Array ( [titleCapitalization] =&gt; 0 [primaryCreatorFirstStyle] =&gt; 1 [primaryCreatorOtherStyle] =&gt; 1 [primaryCreatorInitials] =&gt; 0 [primaryCreatorFirstName] =&gt; 1 [otherCreatorFirstStyle] =&gt; 0 [otherCreatorOtherStyle] =&gt; 0 [otherCreatorInitials] =&gt; 0 [dayFormat] =&gt; 0 [otherCreatorFirstName] =&gt; 1 [primaryCreatorList] =&gt; 1 [otherCreatorList] =&gt; 0 [monthFormat] =&gt; 1 [editionFormat] =&gt; 1 [primaryCreatorListMore] =&gt; 7 [primaryCreatorListLimit] =&gt; 6 [dateFormat] =&gt; 1 [primaryCreatorListAbbreviation] =&gt; , et al. [otherCreatorListMore] =&gt; [runningTimeFormat] =&gt; 1 [primaryCreatorRepeatString] =&gt; [primaryCreatorRepeat] =&gt; 0 [otherCreatorListLimit] =&gt; [otherCreatorListAbbreviation] =&gt; [pageFormat] =&gt; 2 [editorSwitch] =&gt; 1 [editorSwitchIfYes] =&gt; editor (^Ed.^Eds.^). [primaryCreatorSepFirstBetween] =&gt; , [primaryCreatorSepNextBetween] =&gt; , [primaryCreatorSepNextLast] =&gt; , &amp; [otherCreatorSepFirstBetween] =&gt; , [otherCreatorSepNextBetween] =&gt; &amp; [otherCreatorSepNextLast] =&gt; &amp; [primaryTwoCreatorsSep] =&gt; , &amp; [otherTwoCreatorsSep] =&gt; &amp; )</code></p>
39<p>Not all elements need be present so you should always test with PHP's <code>array_key_exists()</code> function. </p>
40<p>Because OSBib uses numeric indexing from 0 upwards, you should be careful to use something like:<br>
41    <span class="style3"><code>if($styleCommon['primaryCreatorListAbbreviation'] === FALSE)<br>
42  ...</code></span></p>
43<p>to test for a FALSE value of an array element.</p>
44<p>The <em>styleTypes</em> array for a book (each type of resource has its own definition array), as returned by <span class="style3"><code><a href="osbib.html#bibformatLoadstyle">BIBFORMAT::loadStyle()</a></code></span> and after being further parsed by <span class="style3"><code><a href="osbib.html#bibformatGetstyle">BIBFORMAT::getStyle()</a></code></span> will look something like (array elements will depend on the type's template definition):<br>
45    <code class="style9">Array ( [author] =&gt; Array ( [dependentPre] =&gt; [dependentPreAlternative] =&gt; [dependentPostAlternative] =&gt; [singular] =&gt; [plural] =&gt; [pre] =&gt; [post] =&gt; . ) [publicationYear] =&gt; Array ( [dependentPre] =&gt; [dependentPreAlternative] =&gt; [dependentPostAlternative] =&gt; [singular] =&gt; [plural] =&gt; [pre] =&gt; ( [post] =&gt; ). ) [title] =&gt; Array ( [dependentPre] =&gt; [dependentPreAlternative] =&gt; [dependentPostAlternative] =&gt; [singular] =&gt; [plural] =&gt; [pre] =&gt; [i] [post] =&gt; [/i] ) [translator] =&gt; Array ( [dependentPre] =&gt; [dependentPost] =&gt; [dependentPreAlternative] =&gt; [dependentPostAlternative] =&gt; [singular] =&gt; [plural] =&gt; [pre] =&gt; [post] =&gt; , Trans.__DEPENDENT_ON_NEXT_FIELD__ ) [edition] =&gt; Array ( [dependentPre] =&gt; [dependentPost] =&gt; [dependentPreAlternative] =&gt; [dependentPostAlternative] =&gt; [singular] =&gt; [plural] =&gt; [pre] =&gt; [post] =&gt; ed.__DEPENDENT_ON_NEXT_FIELD__ ) [volumeNumber] =&gt; Array ( [dependentPre] =&gt; [dependentPreAlternative] =&gt; [dependentPostAlternative] =&gt; [singular] =&gt; [plural] =&gt; [pre] =&gt; Vol. [post] =&gt; ) [publisherLocation] =&gt; Array ( [dependentPre] =&gt; [dependentPreAlternative] =&gt; [dependentPostAlternative] =&gt; [singular] =&gt; [plural] =&gt; [pre] =&gt; . [post] =&gt; : ) [publisherName] =&gt; Array ( [dependentPre] =&gt; [dependentPreAlternative] =&gt; [dependentPostAlternative] =&gt; [singular] =&gt; [plural] =&gt; [pre] =&gt; __DEPENDENT_ON_PREVIOUS_FIELD__ [post] =&gt; ) [ultimate] =&gt; . [independent] =&gt; Array ( [3] =&gt; ( [5] =&gt; ) ) )</code></p>
46<hr>
47<h3><a name="structure"></a>STRUCTURE</h3>
48<p>The description here relates to the various elements of the <em>styleCommon</em> array. Each element will have either an INTEGER value or a STRING value. </p>
49<table width="100%"  border="0" cellpadding="10" bgcolor="#CCCCCC">
50  <tr>
51    <td><h4>Creator formatting:</h4>
52    <p><span class="style11">Primary creators:<br>
53    </span>Primary creators are usually the author(s) of a resource but, depending on the type of resource, may be composers, inventors etc. etc. etc.
54    <p><span class="style3"><code>INTEGER primaryCreatorFirstStyle</code></span> Ordering and display of the name elements for the first of the primary creators. <br>
55        <code><span class="style3">INTEGER primaryCreatorOtherStyle</span></code> Ordering and display of the name elements for the remaining primary creators.
56    <pre>
57	 0	=>	'Joe Bloggs'
58	 1	=>	'Bloggs, Joe'
59	 2	=>	'Bloggs Joe'
60	 3	=>	Last name only</pre><p><span class="style3"><code>INTEGER primaryCreatorInitials</code></span> Formatting of initials for the primary creators.
61    <pre>
62	 0	=>	'T. U. '
63	 1	=>	'T.U.'
64	 2	=>	'T U '
65	 3	=>	'TU'</pre>    <p><span class="style3"><code>INTEGER primaryCreatorFirstName</code></span> Formatting of first name for the primary creators.
66    <pre>
67	 0	=>	Print the full first name(s)
68	 1	=>	Print initial(s) only</pre>    <p><span class="style3"><code>STRING primaryCreatorUpperCase</code></span> Uppercase/lowercase primary creator names. The value will be 'on' for yes otherwise the array element does not exist.</p>
69    <p><span class="style3"><code>STRING primaryTwoCreatorsSep</code></span> Separator in the case of just two primary creators. </p>        <p><span class="style3"><code>STRING primaryCreatorSepFirstBetween</code></span> Separator between the first two primary creators in the case where there are more than two. </p>
70    <p><span class="style3"><code>STRING primaryCreatorSepNextBetween</code></span> Separator between the following primary creators after the first two in the case where there are more than two.</p>
71    <p><span class="style3"><code>STRING primaryCreatorSepNextLast </code></span> Separator between the last two primary creators in the case where there are more than two.</p>
72    <p><span class="style3"><code>INTEGER primaryCreatorList</code></span> Abbreviations for multiple primary creators. </p>
73	<pre>
74	 0	=>	Print the full creator list
75	 1	=>	Limit the creator list
76</pre>    <p><span class="style3"><code>INTEGER primaryCreatorListMore</code></span> If more than this number of primary creators, format as per the limit defined here. Requires <span class="style3"><code>primaryCreatorList</code></span> to be '1'. </p>
77    <p><span class="style3"><code>INTEGER primaryCreatorListLimit</code></span> Print only this number of primary creators if limit is exceeded as defined here. Requires <span class="style3"><code>primaryCreatorList</code></span> to be '1'.</p>
78    <p><span class="style3"><code>STRING primaryCreatorListAbbreviation</code></span> If limit is exceeded as defined here, replace remaining primary creators with this string. Requires <span class="style3"><code>primaryCreatorList</code></span> to be '1'.</p>
79    <p><span class="style3"><code>STRING primaryCreatorListAbbreviationItalic</code></span> Italicize <span class="style3"><code>primaryCreatorListAbbreviation</code></span>. Requires <span class="style3"><code>primaryCreatorList</code></span> to be '1'. The value will be 'on' for yes otherwise the array element does not exist.</p>
80    <p><span class="style3"><code>INTEGER primaryCreatorRepeat</code></span> Consecutive citations in the bibliographic list by the same primary creator(s). </p>    <pre>
81	 0	=>	Print the creator list
82	 1	=>	Do not print the creator list
83	 2	=>	Replace the creator list with string below
84</pre>    <p><span class="style3"><code>STRING primaryCreatorRepeatString</code></span> String to replace primary creator(s) with if '2' is chosen for <span class="style3"><code>primaryCreatorRepeat</code></span> above. </p>    <p><span class="style11">Other creators:<br>
85      </span>Other creators include editors, translators, agents, attorneys etc. etc. etc. The usage is as explained above. </p>
86    <p><span class="style3"><code>INTEGER otherCreatorFirstStyle</code></span> Ordering and display of the name elements for the first of the other creators (editors, translators etc.).<br>
87        <code><span class="style3">INTEGER otherCreatorOtherStyle</span></code> Ordering and display of the name elements for the remaining other creators.<span class="style3"><code><br>
88      INTEGER otherCreatorInitials</code></span> Formatting of initials for the other creators.<br>
89      <span class="style3"><code>INTEGER otherCreatorFirstName</code></span> Formatting of first name for the other creators.<br>
90      <span class="style3"><code>STRING otherCreatorUpperCase</code></span> Uppercase/lowercase other creator names.<br>
91      <span class="style3"><code>STRING otherTwoCreatorsSep</code></span> Separator in the case of just two other creators.<br>
92      <span class="style3"><code>STRING otherCreatorSepFirstBetween</code></span> Separator between the first two other creators in the case where there are more than two.<br>
93      <span class="style3"><code>STRING otherCreatorSepNextBetween</code></span> Separator between the following other creators after the first two in the case where there are more than two.<br>
94      <span class="style3"><code>STRING otherCreatorSepNextLast </code></span> Separator between the last two other creators in the case where there are more than two.<br>
95      <span class="style3"><code>INTEGER otherCreatorList</code></span> Abbreviations for multiple other creators.<br>
96      <span class="style3"><code>INTEGER otherCreatorListMore</code></span> If more than this number of other creators, format as per the limit defined here. Requires <span class="style3"><code>otherCreatorList</code></span> to be '1'.<br>
97      <span class="style3"><code>INTEGER otherCreatorListLimit</code></span> Print only this number of other creators if limit is exceeded as defined here. Requires <span class="style3"><code>otherCreatorList</code></span> to be '1'.<br>
98      <span class="style3"><code>STRING otherCreatorListAbbreviation</code></span> If limit is exceeded as defined here, replace remaining other creators with this string. Requires <span class="style3"><code>otherCreatorList</code></span> to be '1'.<br>
99      <span class="style3"><code>STRING otherCreatorListAbbreviationItalic</code></span> Italicize <span class="style3"><code>otherCreatorListAbbreviation</code></span>. Requires <span class="style3"><code>otherCreatorList</code></span> to be '1'.</p></td>
100  </tr>
101</table>
102<br>
103<table width="100%"  border="0" cellpadding="10" bgcolor="#CCCCCC">
104  <tr>
105    <td><h4><span class="style3"><code><a name="utf8EncodeUtf8" id="utf8EncodeUtf8"></a></code></span>Miscellaneous formatting:</h4>
106    <p><span class="style11">Editor switch:<br>
107        </span>If a resource, such as a book, has an editor(s) but no author(s), then some bibliographic styles require that the editor(s) take the usual place of the author(s) when printing the bibliographic list.
108    <p><span class="style3"><code>INTEGER editorSwitch </code></span> Consecutive citations in the bibliographic list by the same primary creator(s).
109    <pre>
110	 0	=>	No switch
111	 1	=>	Switch
112</pre>    <p><span class="style3"><code>STRING editorSwitchIfYes </code></span> If '1' is chosen for <span class="style3"><code>editorSwitch</code></span> above, this is the template definition string such as
113
114
115    <span class="style13"><code>editor (^Ed.^Eds.^)</code></span> that the primary creator definition string in each resource type's template definition is replaced with.</p>
116    <p><span class="style11">Title capitalization:<br>
117    </span><span class="style3"><code>INTEGER titleCapitalization</code></span></p>
118    <pre>
119	 0	=>	Title as entered/stored in the database
120	 1	=>	Only first character of first word capitalised
121</pre>    <p>Note that <span class="style3"><code><a href="osbib.html#bibformatFormattitle">BIBFORMAT::formatTitle()</a></code></span> allows characters to be protected from case changes.</p>
122    <p><span class="style11">Edition:<br>
123    </span><span class="style3"><code>INTEGER editionFormat </code></span></p>
124    <pre>
125	 0	=>	'3'
126	 1	=>	'3rd'</pre>    <p><span class="style11">Page number:<br>
127     </span><span class="style3"><code>INTEGER pageFormat </code></span></p>
128	 <pre>
129	 0	=>	'132-9'
130	 1	=>	'132-39'
131	 2	=>	'132-139'
132</pre>
133	 <p><span class="style11">Day:<br>
134     </span><span class="style3"><code>INTEGER dayFormat </code></span></p>
135	 <pre>
136	 0	=>	'10'
137	 1	=>	'10th'</pre>
138	 <p><span class="style11">Month:<br>
139     </span><span class="style3"><code>INTEGER monthFormat </code></span></p>
140	 <pre>
141	 0	=>	'Feb'
142	 1	=>	'February'
143	 2	=>	"User-defined"
144</pre>
145If '2', the <em>styleCommon</em> array
146will	have 12 string elements for each month: <code><span class="style3">userMonth_1 </span></code>.. <span class="style3"><code>userMonth_12</code></span>
147<p><span class="style11">Date:<br>
148     </span><span class="style3"><code>INTEGER dateFormat </code></span></p>
149	 <pre>
150	 0	=>	Day followed by Month
151	 1	=>	Month followed by Day
152</pre>
153	 <p><span class="style11">Running time:<br>
154     </span><span class="style3"><code>INTEGER runningTimeFormat </code></span></p>
155    <pre>
156	 0	=>	'3'45"'
157	 1	=>	'3:45'
158	 2	=>	'3,45'
159	 3	=>	'3 hours, 45 minutes'
160	 4	=>	'3 hours and 45 minutes'</pre><p><span class="style11">Date ranges:<br>
161    </span><span class="style3"><code>STRING dateRangeDelimit1 </code></span> Separator between start and end dates if day and month given.<br>
162      <span class="style3"><code>STRING dateRangeDelimit2</code></span> Separator between start and end dates if month only given.<br>
163      <span class="style3"><code>INTEGER dateRangeSameMonth </code></span>If start and end months are the same.</p>
164    <pre>
165	 0	=>	"Print both months",
166	 1	=>	"Print start month only",</pre></td>
167  </tr>
168</table>
169<p>&nbsp; </p>
170</body>
171</html>
172