Problems using EXSLT date module in XML Spy 2005 or Oxygen 6.2

"Allison Bloodworth" <[email protected]>
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
Hi, 

I am working on an application that uses the date EXSLT date functions (e.g.
date:month-name(./DateTime/StartDate)). It works in a PHP application doing
the transformation using libxslt and everything is working fine there.
However, I am trying to do de-bugging on my system in XML Spy 2005 and/or
Oxygen 6.2 (where I usually select the Saxon 6.5.4 transformation engine,
but I've also tried xsltproc, Xalan, and MSXML 4.0). I have used Xalan and
Saxon on the command line but am having problems with them right now and
would prefer to use a GUI editor for this anyway.

My problem is that I am getting all kinds of errors with these stylesheets.
I began this process by adding the following import declaration to my XSLT
based on the instructions on the "How To" section of the EXSLT website
(http://www.exslt.org/howto.html):

<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateCompo
nents-1.0"
	
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponent
s-1.0"
	xmlns:date="http://exslt.org/dates-and-times"
extension-element-prefixes="date"
	xmlns:php="http://php.net/xsl"
	>
	<xsl:import href="EXSLT-date/date.xsl"/>

But when I do the transformation, I get the following errors in Oxygen with
Saxon 6.5.4 (and similar ones in XML Spy, as well as using other
transformation engines in Oxygen, but these are the best error
descriptions):

Description: E Failed to compile stylesheet. 27 errors detected.
-------------------------------
SystemID:
C:\eclipse\workspace\EventModel\UCBCN\EXSLT-date\functions\format-date\date.
format-date.xsl
Location: 5:0
Description: E xsl:import elements must come first

So in the date.format-date.xsl, the processor doesn't like the fact that
there are func: elements before import, e.g.

   <func:script language="exslt:javascript" implements-prefix="date"
src="date.js"/>
   <func:script language="exslt:msxsl" implements-prefix="date"
src="date.msxsl.xsl"/>
   <import href="date.format-date.function.xsl"/>
   <import href="date.format-date.template.xsl"/>
------------------------------
SystemID:
C:\eclipse\workspace\EventModel\UCBCN\EXSLT-date\functions\format-date\date.
format-date.function.xsl
Location: 9:0
Description: E Failure reading
file:/C:/eclipse/workspace/EventModel/UCBCN/EXSLT-date/functions/format-date
/str.padding.function.xsl

Here it's looking for a file that is for some reason not in the folder I
just downloaded in the date package. Where do I get this file?
----------------------------------
SystemID:
C:\eclipse\workspace\EventModel\UCBCN\EXSLT-date\functions\format-date\date.
format-date.xsl
Location: 6:0
Description: E xsl:import elements must come first

Same error as above. How can I fix this?
------------------------------------
SystemID:
C:\eclipse\workspace\EventModel\UCBCN\EXSLT-date\functions\format-date\date.
format-date.template.xsl
Location: 8:0
Description: E Failure reading
file:/C:/eclipse/workspace/EventModel/UCBCN/str/functions/padding/str.paddin
g.template.xsl

And it seems to be looking for files in the str package that I don't think I
should have to be using if I'm using date functions only. But if I look in
that file, sure enough, it needs to be imported, so did fix this, but the
site really shouldn't say you can use packages by themselves if there may be
dependencies.
<xsl:import href="../../../str/functions/padding/str.padding.template.xsl"
/>
------------------------------------
SystemID: C:\eclipse\workspace\EventModel\UCBCN\UCBCN_ajb.xsl 
Location: 1262:0 
Description: E Variable from has not been declared

Refers to this line: 
<xsl:when test="date:day-in-year($from) &gt; date:day-in-year($to)">
--------------------------------------
SystemID: C:\eclipse\workspace\EventModel\UCBCN\UCBCN_ajb.xsl
Location: 2456:0
Description: E Variable day has not been declared

Refers to this line: 
<xsl:when test="Events/Event/DateTime/StartDate =
concat(Events/View/DateYear, '-', Events/View/DateMonth, '-',
format-number($day, '00')) ">
---------------------------------------
The rest of the errors are similar to these last two.

I don't know if these last two errors mean the system couldn't find the
functions or if something else is wrong? I even tried creating an xsl file
to test whether the functions were available as described in the "Ensuring
Portability with Extension Functions" section, but there I get the same
errors about "import elements must come first." 

I am really stumped and any help would be appreciated. 

Allison Bloodworth
Principal Administrative Analyst
Technology Program Office
University of California, Berkeley
(415) 377-8243
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.