ticket #1

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

ticket #1

Bruce D'Arcus
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



Reply | Threaded
Open this post in threaded view
|

Re: ticket #1

Bruce D'Arcus
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:text>Anonymous</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



Reply | Threaded
Open this post in threaded view
|

Re: ticket #1

M. David Peterson-2
In reply to this post by Bruce D'Arcus
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:
 
<item cmd="output" type="linear">
<sequence match="name">
<item name="lastname" true="print-value" false="print'No Last Name' and test-child">
   <item type="output" mandatory="true">, </item>
   <item name="firstname" true="print-value" false="print'No First Name' and call-sequence'no-first-name'"/>
</item>
</sequence>
</item>
 
The xml that is being processed might look like:
 
<name>
   <last-name>Peterson
      <first-name/>
   </last-name>
</name>
 
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 <[hidden email]> wrote:
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

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
xbiblio-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xbiblio-devel



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist
Reply | Threaded
Open this post in threaded view
|

Re: ticket #1

M. David Peterson-2
In reply to this post by Bruce D'Arcus
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 <[hidden email]> wrote:
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:text>Anonymous</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

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
xbiblio-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xbiblio-devel



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist
Reply | Threaded
Open this post in threaded view
|

Re: ticket #1

M. David Peterson-2
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 <[hidden email]> 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 <[hidden email]> wrote:
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:text>Anonymous</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

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://ads.osdn.com/?ad_id=6595&amp;alloc_id=14396&amp;op=click" target="_blank">http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
xbiblio-devel mailing list
[hidden email]
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/xbiblio-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/xbiblio-devel



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist
Reply | Threaded
Open this post in threaded view
|

Re: ticket #1

M. David Peterson-2
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> wrote:
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:text>Anonymous</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

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://ads.osdn.com/?ad_id=6595&amp;alloc_id=14396&amp;op=click" target="_blank">http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
xbiblio-devel mailing list
[hidden email]
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/xbiblio-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/xbiblio-devel



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist
Reply | Threaded
Open this post in threaded view
|

Re: ticket #1

M. David Peterson-2
In reply to this post by M. David Peterson-2
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> wrote:
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:text>Anonymous</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

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://ads.osdn.com/?ad_id=6595&amp;alloc_id=14396&amp;op=click" target="_blank">http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
xbiblio-devel mailing list
[hidden email]
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/xbiblio-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/xbiblio-devel



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist
Reply | Threaded
Open this post in threaded view
|

Re: ticket #1

M. David Peterson-2
oops... "Please know" not "no" :D

On Apr 2, 2005 11:02 AM, M. David Peterson <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> wrote:
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:text>Anonymous</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

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://ads.osdn.com/?ad_id=6595&amp;alloc_id=14396&amp;op=click" target="_blank">http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
xbiblio-devel mailing list
[hidden email]
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/xbiblio-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/xbiblio-devel



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist
Reply | Threaded
Open this post in threaded view
|

Re: ticket #1

Bruce D'Arcus
In reply to this post by M. David Peterson-2
On Apr 2, 2005, at 12:57 PM, M. David Peterson 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...

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

Bruce



Reply | Threaded
Open this post in threaded view
|

Re: ticket #1

M. David Peterson-2
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:text>Anonymous</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 <[hidden email]> wrote:

On Apr 2, 2005, at 12:57 PM, M. David Peterson 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...

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

Bruce

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
<a href="http://ads.osdn.com/?ad_ide95&amp;alloc_id396&amp;opclick">http://ads.osdn.com/?ad_ide95&alloc_id396&opclick
_______________________________________________
xbiblio-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/xbiblio-devel



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist
Reply | Threaded
Open this post in threaded view
|

Re: ticket #1

M. David Peterson-2
K, Im really late now... but I just have to pick someone up and drop them somewhere else so I wont be long

On Apr 2, 2005 11:15 AM, M. David Peterson <[hidden email]> wrote:
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:text>Anonymous</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 <[hidden email]> wrote:

On Apr 2, 2005, at 12:57 PM, M. David Peterson 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...

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

Bruce

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://ads.osdn.com/?ad_ide95&amp;alloc_id%14396&amp;opclick" target="_blank">http://ads.osdn.com/?ad_ide95&alloc_id396&opclick
_______________________________________________
xbiblio-devel mailing list
[hidden email]
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/xbiblio-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/xbiblio-devel



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist



--
<M:D/>

:: M. David Peterson ::
XML & XML Transformations, C#, .NET, and Functional Languages Specialist