[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: EXSLT extension function

Subject: Re: EXSLT extension function
From: "cking" <cking@xxxxxxxxxx>
Date: Sat, 31 Jul 2004 17:15:33 +0200
transformerexception elemtemplateelement error
Hi Chris,

you did import the exslt date stylesheet, didn't you?
(I don't see it in your fragment):
<xsl:import href="date.xsl" />

If you didn't, your stylesheet will know nothing about the named extension 
templates (in other words, you're calling templates that don't exist)

But I suppose you did import it... Then take a look at your template calls:

  <xsl:call-template name="date:hour-in-day"/>

You are calling the template with no parameters! How can the template
know what date/time you want to extract the hours of?

You will need something like:

  <xsl:call-template name="date:hour-in-day">
    <xsl:with-param name="date-time" select="$date-str"/>
  </xsl:call-template>

If you want the current system time, you will need to call the
appropriate function "date:date-time()". 

(see http://www.exslt.org/date/functions/date-time/index.html)

HTH,
Anton Triest


----- Original Message ----- 
From: "Chris Loschen" <closchen@xxxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, July 30, 2004 10:24 PM
Subject:  EXSLT extension function


> Hi everybody!
> 
> I'm trying to pull in the system time (I'll want the date as well, but one 
> thing at a time...)
> to my XSLT stylesheet. It looked like the EXSLT functions had just what I 
> need, and
> they're supposedly supported by my XSLT processor (Xalan-J 2.6). But I'm 
> getting this
> error:
> 
> javax.xml.transform.TransformerException: ElemTemplateElement error: 
> date:hour-in-day
> 
> I might have the namespace wrong or perhaps I'm not calling the extension 
> function
> correctly? I've done a Google search without finding anything. Anybody have any
> ideas? Thanks!
> 
> Here is a fragment of the stylesheet (I know it's not well-formed -- I'm 
> just copying the relevant section):
> 
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
>          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>          xmlns:date="http://exslt.org/dates-and-times"
>          extension-element-prefixes="date">
> 
> <xsl:output method="xml" version="1.0" omit-xml-declaration="yes" 
> indent="yes" />
> 
> <xsl:template match="BillHeader">
>          <xsl:variable name="time">
>                  <xsl:variable name="hours">
>                          <xsl:call-template name="date:hour-in-day"/>
>                  </xsl:variable>
>                  <xsl:variable name="minutes">
>                          <xsl:call-template name="date:minute-in-hour"/>
>                  </xsl:variable>
>                  <xsl:value-of select="concat($hours,$minutes)"/>
>          </xsl:variable>
> 
> etc.
> 
> Yours,
> 
> Chris Loschen
> closchen@xxxxxxxxxxxxxxxxxx
> 781-718-3017 (cell)

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.