Re: One problem using Date:add utility from exslt
[email protected] Wed, 12 Nov 2008 16:54:27 +0000
| Newsgroups | gmane.text.xml.xslt.extensions |
|---|---|
| Message-ID | <OF8731EA38.4795ED1D-ON802574FF.005B23F2-802574FF.005CE08D@bnpparibas.com> |
Hi Nagendra,
I use exslt dates-and-times functions by importing the XSLT implementation
as named templates, so for example:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
exclude-result-prefixes="date" >
<xsl:include href = "exslt/date.add.template.xsl" />
<xsl:template match="/">
<xsl:call-template name = "date:add">
<xsl:with-param name = "date-time" select = "'2000-01-01'" />
<xsl:with-param name = "duration" select = "'P20D'" />
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
- should work just fine (note, in this example, the exslt script is located
in a 'exslt' sub-directory). It's not as neat as defining an extension
function (I don't have any experience of doing this with Xalan-J; I'm not
sure if it's supported), but has the advantage of portability - I'm writing
code to run under both Xalan and MSXML.
I guess you read the advice on using extension functions at
http://www.exslt.org/howto.html?
Best regards,
Harry
Internet
Nagendra.Malli
[email protected] To
[email protected]
Sent by: cc
exslt-bounces@
lists.fourthou Subject
ght.com [exslt] One problem using Date:add
utility from exslt
12/11/2008
09:05
Hi,
I am trying to use the date-and-times package to get current date and 6
months back date. The date:add function to add duration to date is giving
the following error. Any idea what could have gone wrong.
->java org.apache.xalan.xslt.Process -in test.xml -xsl test.xsl
file:///home/mallin/test.xsl; Line #11; Column #57; XSLT Error
(javax.xml.transform.TransformerConfigurationException):
javax.xml.transform.TransformerException:
javax.xml.transform.TransformerException: Illegal value:
date:add('2000-01-01','P20D') used for QNAME attribute: name
Exception in thread "main" java.lang.RuntimeException:
javax.xml.transform.TransformerException:
javax.xml.transform.TransformerException: Illegal value:
date:add('2000-01-01','P20D') used for QNAME attribute: name
at org.apache.xalan.xslt.Process.doExit(Process.java:1153)
at org.apache.xalan.xslt.Process.main(Process.java:1126)
cat test.xsl
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
extension-element-prefixes="date"
version="1.0">
<xsl:template match="/">
<xsl:call-template name="date:add('2000-01-01','P20D')">
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
Thanks
Nagendra M
AML Compliance IT _______________________________________________
exslt mailing list
[email protected]
http://www.exslt.org/list
BNP Paribas is proud to support the Royal Academy of Arts in their presentation of ‘Miro, Calder, Giacometti, Braque: AIMÉ MAEGHT AND HIS ARTISTS’ at the Sackler Wing of Galleries from 4 October 2008 to 2 January 2009.
This communication is confidential, may be privileged and is meant only for the intended recipient. If you are not the intended recipient, please notify the sender by reply and delete the message from your system. Any unauthorised dissemination, distribution or copying hereof is prohibited.
BNP Paribas Fund Services UK Limited, BNP Paribas Trust Corporation UK Limited, BNP Paribas UK Limited, BNP Paribas Commodity Futures Limited, BNP Paribas Asset Management UK Limited and Investment Fund Services Limited are authorised and regulated by the Financial Services Authority.
BNP Paribas London Branch and BNP Paribas Private Bank London Branch are authorised by the CECEI and supervised by the Commission Bancaire.
BNP Paribas London Branch is authorised and subject to limited regulation by the Financial Services Authority. Details about the extent of our authorisation and regulation by the Financial Services Authority are available from us on request. BNP Paribas is also a member of the London Stock Exchange.
BNP Paribas Private Bank London Branch is subject to limited regulation by the Financial Services Authority. Details about the extent of our authorisation and regulation by the Financial Services Authority are available from us on request.
BNP Paribas Securities Services London Branch is authorised by the CECEI and supervised by the AMF, and subject to limited regulation by the Financial Services Authority. Details on the extent of our regulation by the Financial Services Authority are available from us on request. BNP Paribas Securities Services is also a member of the London Stock Exchange.
_______________________________________________
exslt mailing list
[email protected]
http://www.exslt.org/list