469,957 Members | 2,665 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,957 developers. It's quick & easy.

passing date parameter to an XSLT

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

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

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


Sep 21 '06 #1
2 2200
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

Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Sep 21 '06 #2
yeah that works ..tx a million..


Sep 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Craig Petrie | last post: by
7 posts views Thread by Harolds | last post: by
reply views Thread by stevag | last post: by
6 posts views Thread by David Schwartz | last post: by
2 posts views Thread by Peter Laman | last post: by
reply views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.