Re: (dsssl) Practical Bibliography question

Subject: Re: (dsssl) Practical Bibliography question
From: Trent Shipley <tcshipley@xxxxxxxxxxxxx>
Date: Sun, 7 Oct 2001 18:04:31 -0700
>  > The point is that I am hoping SAXON will have a pretty full
>  > implementation of Xpointers that will make the transformation much
>  > easier.
>
> Saxon does not implement Xpointers. Why do you think you need them.
>

Of course the core language of DSSSL should be orthoganal to the problem 
space.  One hopes the same is true of XSLT.  It follows that one never really 
"needs" tree or text regular expressions in an absolute sense.

However, there remains the problem of the programmers (in)competence, 
practicality, and deadlines.  The practical need for Xpointers, node-regular 
expressions or other tree and text searching or pattern matching facilities I 
leave to those more experienced than myself based on the conversion process 
described (but not prescribed) by the following pseudo-code.

(PS. it is very long.  I don't actually recommend reading it. ; )
)

============

The process has two major components:
1 Synchonization
2 Fomatting

=============

1 Synchronization

1.1 Citations occur in the text in the <bibl> tag.
1.1.1  A <bibl> tag will contain <author>+, <date>, and optionally <title>.  
The children of <bibl> occur in no particular order an can be mixed with 
PCDATA.
1.1.2  Note that an <author> will either have no children and its data will 
be a last name or it will have children and one of the children will be of 
the form <name part="last">

1.2 Collect the <bibl> tags and their <author>+, <date>, and <title> children.

1.3 Make the list resulting from 1.2 unique in terms of the data contained by 
each  <bibl> sub-tree.

1.4 Compare each <bibl> in 1.3 to the list of biblograpic entries that 
consists of <tei:biblStruct>s (a complete implementation would work with 
<tei:biblFull> or even another list of <tei:bibl>).  
1.4.1 The first comparison would be between the two author lists.
1.4.2 The second comparison will be of dates.
1.4.3 If a title is present in the citation list it should be compared to the 
entry list.

1.5 Output
1.5.1 A list of <biblStruct>s that matched a <bibl>
1.5.2 An exception list of <bibl>s that failed to match.
1.5.3 An exception list of <bibl> and a list of <biblStruct>s for 
<bibl> that matched more than one document base entry.

============

2. Formatting

--

2.1 f[0] (listBibl biblStruct)  Sort author lists

2.1.1 For each <biblStruct> sort <author>s

2.1.2 Collation
2.1.2.1  If the author.n attribute exists sort authors by the value of 
author.n
2.1.2.2  If author.n is not specified sort authors alphabetcally based on the 
data value of author
2.1.2.2.1 If author contains no children use the resulting data
2.1.2.2.2 If author contains children they will be <name> elements
2.1.2.2.2.1 If author <name> does not have an atribute name.part then it is 
unitary
2.1.2.2.2.1.1 if a unitary name has a name.type and name.type includes the 
substring sortAs-ln (eg type="organization-sortAs-EN") then collate using the 
most appropriate sortAs-ln code.
2.1.2.2.2.1.2 Else sort using the first <name> encountered.

2.1.2.2.2.2 If the name.part exists
2.1.2.2.2.2.1 collate by name.part="last"
2.1.2.2.2.2.1.1 if a last name has a name.type and name.type includes the 
substring sortAs-ln (eg type="organization-sortAs-EN") then collate using the 
most appropriate sortAs-lang code.
2.1.2.2.2.2.1.2 Else sort using the first <name> encountered.
2.1.2.2.2.2.2 Sub-collate for first name  or the name.part value 
"first-initial" like you did for last name.
2.1.2.2.2.2.3 Collate for middle names or intitials
2.1.2.2.2.2.3.1 If name.part=="middle" or "middle-initial" and there is no 
value of name.n sub-collate as for first name.
2.1.2.2.2.2.1.2 If name.n has a value collate as for first-name based on the 
value of name.n

2.1.3 Output 
2.1.3.1 Option: output the resulting list of <biblStruct>s with names in 
proper collation order for the specfied target language (eg EN)
2.1.3.2 Pass resulting structure to next program

------------

2.2 f[1] (listBibl biblStruct) Sort biblStructs

2.2.1 Sort by author
2.2.1.1 Sort by last name (or only name, or bare name, see 2.1.2.2)
2.2.1.1.1 If "last"==name.part 
2.2.1.1.2 And sortAs-ln is a substring of name.type then sort by best sortAs 
criteria based on match of ln (eg ln could be EN)
2.2.1.1.3 Else sort by the first "last"==name.part found.
2.2.1.2 Sort by first name (if any) like for last name.
2.2.1.3 Sort for middle names, allow for multiple middle names with ascending 
values of name.n 
2.2.1.4 Sort by date (this is always year of publication)
2.2.1.5 Sort by title.  Note that title.type can have a sortAs-ln substring.

2.2.2 Output 
2.2.2.1 Option: output the resulting list of <biblStruct>s in proper 
collation order for the specfied target language (eg EN)
2.2.2.2 Pass resulting structure to next program

----------------

f[3] (listBibl biblStruct) Cook

<!-- NB this varies considerably by manual of style 
     No doubt need different modules for MLA, History, Chemistry, etc 
The following is for cultural anthropology
It is reasonable to combine this with the printable format step or to do one 
more transform on the data, then apply a style.  

This assumes one more transform without a style.
-->

For each 

3.1 First author's last name + ', ' first-name-or-initial + ', ' middles 
3.2 Next two authors First + Middles + Last
3.3 If more than three authors add <hi>et al</>
3.4 <date> is date
3.5 if author list and date data are identical to the data of the same for 
the next biblStruct in the source data then append the value of the local 
enumeration [a,b,..] to the date in step 3.4
<!-- Though not specified in this pseudo-code the ideal formatter-synchonizer 
would go back and decorate the <date> for every citation to this entry -->
3.6 Analytic title (if any)
3.7 Monograph title (if any, retaining level code)
3.8 Up to three editor==editor.type in the form "firsts middles last"
3.9 Up to three tranlsator==editor.type in form "firsts middles last"
3.10 if "j"!=mongr.level
3.10.1 pubLoc
3.10.2 Publisher
3.11 If "j"=mongr.level
3.11.1 biblScope for volume
3.11.2 biblScope for issue number
3.12 biblScope for pages, if any

In this form formatting the paragraphs, decorating text, and inserting 
punctuation should be (mostly) trivial.

--


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist

Current Thread