ticket #1

OK, am trying to wrap my head around how to solve ticket #1 to get
proper output for the legal case example (Tremblay v. Quebec). If you
look at this lines 380-2:

             <xsl:otherwise>
               <xsl:value-of select="bib:noname-substitute"/>
             </xsl:otherwise>

What this is doing is saying if there is no mods:name, then use the
in-memory noname-substitute content.

This assumes that all reftypes will consider the creator name as the
primary sort key. However, as we’ve seen with legal cases, this isn’t
a safe assumption.

Perhaps instead of radically redoing the code, though, we could just
have an xpath expression that first looks to see if the first child of
cs:reftype is something other than cs:creator (like cs:title in the
legal case) and uses that if present. It could then use
noname-substitute as the ultimate fallback.

IIRC, the xpath 2 expression might be:

<xsl:value-of select=“cs:*[1 and not(cs:creator)],
bib:noname-substitute”/>

Is that right David? Does it make sense?

Bruce

Might be easier/better still to handle this properly in the
nonname-substitute variable:

               <xsl:variable name="noname-substitute">
                 <xsl:choose>
                   <xsl:when test="not(mods:name) and  

bib:refclass(.)=‘part-inSerial’">
<xsl:value-of

select=“mods:relatedItem[@type=‘host’]/mods:titleInfo[not(@type)]/mods:
title”/>
</xsl:when>
<xsl:when test=“not(mods:name) and
not(bib:refclass(.)=‘part-inSerial’)”>
xsl:textAnonymous</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:variable>

Am still not quite sure how this should work between the CSL schema and
the XSLT code.

The “Anonymous” bit also needs to be configured somehow in the CSL.

Bruce

Ok… I can see what you are saying and it may make more sense, for now, to
do this instead of what I have been implementing. Just so you can understand
what I have been trying to do is to simplu create a logic stack in which
elements are formed in a proper heirarchery in which the parent element will
be checked first and use a set of test attributes to determine if the
current element passes and if it doesnt then what should happen next.
For example, a simple stack (non-specific to this project) might be:



,




The xml that is being processed might look like:

Peterson



This will be processed based on the rules set forth in a seperate
definition file which tells the XSLT processor what to do when it encounters
a certain element with a particular value. This particular logic would state
that if an element by the name “item” is located with the cmd attribute
equal to output then it should check what type of output sequence to run (in
this case linear.) the next item found matches to the element name
’sequence’ and as such is treated as a unit that inherits the linear value
during the processing. Once inside this sequence there is a series of item
elements that have a match attribute and tell the processor what to do if
the first child element is called ‘last-name’ and what to do if its not
using the attributes true and false. The first child element has a mandatory
attribute equal to true and therefore follows the rules set forth for
mandatory elements. The next child tells the processor what to do if the
child element in context has a name value of “first-name” and then what to
do if not.
So the output of the processed XML would be “Peterson, No First Name” and
might also contain any additional text or a comment if the sequence
"no-first-name" tells the processor to some how notify the end-user that a
certain event transpired. This sould be pretty obviously as to what it looks
like so I wont spend the time to add this sequnce to the stack tree.
Does this make sense? By using this stacked way of processing elements
there is a natural order that is implied by the heirarchy as well as the
ability to tell the processor what to do next when the test on the current
elements matches to true or false. It would be a piece of cake to access
another external file that contains the order of elements to test for and
what to do when one finally matches to true. This of course then
externalizes the logic even further such that the system is much more
dynamic and responsive to the data being processed.
Let me know your thoughts on this…On Apr 2, 2005 10:07 AM, Bruce D’Arcus <@Bruce_D_Arcus> wrote:

Was this in response to my last reply or did you sent this before you got
that? It seems the time stamps are within seconds of each other so I am
guessing you wrote this first… let me know…On Apr 2, 2005 10:50 AM, Bruce D’Arcus <@Bruce_D_Arcus> wrote:

BTW, I realize that this very much takes the spot of the schemas job but
in developing LispML (which this is where that last piece of code comes
from) I made the decision to bring as much logic processing into the
language itself to then use RNG or Schema to test the final output using
external tools…On Apr 2, 2005 10:57 AM, M. David Peterson <@M_David_Peterson1> wrote:

Oh shoot! I need to run a quick errand. I will be back in less than 30 mins
but I need to run right away…On Apr 2, 2005 10:59 AM, M. David Peterson <@M_David_Peterson1> wrote:

Before I go… please no that I am not suggesting that this is the route
this project has to go. I just want to make sure that you can see things
from as many angles as possible to then decide on future revisions to the
code base accordingly…On Apr 2, 2005 10:59 AM, M. David Peterson <@M_David_Peterson1> wrote:

oops… “Please know” not “no” :DOn Apr 2, 2005 11:02 AM, M. David Peterson <@M_David_Peterson1> wrote:

Before. I just sent a response to your’s.

Bruce

This is the last mail I have a record of (is there more):
Might be easier/better still to handle this properly in the
nonname-substitute variable:

<xsl:variable name=“noname-substitute”>
xsl:choose
<xsl:when test=“not(mods:name) and
bib:refclass(.)=‘part-inSerial’”>
<xsl:value-of

select=“mods:relatedItem[@type=‘host’]/mods:titleInfo[not(@type)]/mods:
title”/>
</xsl:when>
<xsl:when test=“not(mods:name) and
not(bib:refclass(.)=‘part-inSerial’)”>
xsl:textAnonymous</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:variable>

Am still not quite sure how this should work between the CSL schema and
the XSLT code.

The “Anonymous” bit also needs to be configured somehow in the CSL.On Apr 2, 2005 11:05 AM, Bruce D’Arcus <@Bruce_D_Arcus> wrote:

K, Im really late now… but I just have to pick someone up and drop them
somewhere else so I wont be longOn Apr 2, 2005 11:15 AM, M. David Peterson <@M_David_Peterson1> wrote: