passing date parameter to an XSLT

V

vaibhav

Hi
I am writing a wrapper over the XALAN XSLT engine, for transforming XML
documents. My problem is that I need to pass date as a parameter ( with
format mm/dd/yyyy hh.mm.ss) to the XSLT engine at run time (using the
api setStylesheetParam(char* key, char* expression)).

The first argument to setStylesheetParam is the key value and the
second argument is the date expression ( eg it may be like , char* exp
= "12/12/2006 12.12.00 "). But the call fails at run time with the
following error:

XPathParserException: Unexpected token.
expression = '09/22/2006 12.09.09'
Remaining tokens: ( '22' '/' '2006' '12.09' '.09') (, line -1, column
-1)

Now I have two questions:
1)What kind of data types can be handled insie an XSL stylesheet , I
mean when I write something like this
<xsl:param name="day"></xsl:param>
then can I also ensure that what kind of data type day will be?

Also what are the different kinds of data types supported in XSL.

2)Finally how do I pass my date expression as a parameter, without
failures.

I have a deadline to meet, and will be very grateful if you can help

Vaibhav
 
J

Joseph Kesselman

You might want to try "'09/22/2006 12.09.09'", in case Xalan is
interpreting the value as an XPath expression. (If so, the extra layer
of quoting will ensure it's taken as a literal string.)
>What kind of data types can be handled insie an XSL stylesheet

If you mean what kinds can you pass in as parameters... That's up to the
individual XSLT processor. Check its documentation to find out how it
handles this.

If you mean the types supported in XSL: Basically, the types defined by
the XPath specification, plus anything that specific XSLT processor adds
to support extension functions (these latter, of course, being
nonportable).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top