You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Gerald Michalitz <ge...@aon.at> on 2002/07/31 22:40:16 UTC

object rexx script within xslt

im trying to use the objectrexx script within an xsltransformation
my xsl-file has this:
<lxslt:component prefix="my-ext" elements="timelapse" functions="calc">
<lxslt:script lang="ObjectRexx">
 <![CDATA[
/* calc rexx - Object Rexx, ---rgf, 2002-07-30, 03:03, wuw */
parse arg mon +3 . day "," year /* parse date */
 due_date = date("s", space(day mon year), "n") /* convert to a sortable
date */
due_days = date("b", due_date, "s") /* convert to days since 0001-01-01 */
today = date("l") /* get today in a sortable date */
 today_days = date("b") /* convert to days since 0001-01-01 */
days=today_days-due_days /* calc difference of days */
 due_date = date("L", due_date, "s") /* convert to language format */
if days<7
then return ("Die Differenz beträgt zwischen dem Tag der Abgabe:" due_date
"und heutigem Tage:" today days "Tage und wird daher noch toleriert.")
else if days=7
then return "Die Differenz beträgt zwischen dem Tag der Abgabe:" due_date
"und heutigem Tage:" today days "Tage und wird daher gerade noch toleriert."
else /* nur mehr der Fall möglich, dass "days>7" ist ! */
 return ("Die Differenz beträgt zwischen dem Tag der Abgabe:" due_date "und
heutigem Tage:" today days "Tage und wird daher nicht mehr toleriert.")
 ]]>
</lxslt:script>
</lxslt:component>
 <xsl:template match="deadline">
 <p> <xsl:value-of select="my-ext:calc(@due_date)"/> </p>
 </xsl:template>

and my xml-file has this:

<deadline due_date="June 30, 2002"></deadline>

but when i(cocoon) try to transform i get an emty page, it seems that the
rexx script did not get the argument from the deadline-node

if you would be so kind and have a short look at it

thankx

gerald


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>