473,769 Members | 6,404 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

passing date parameter to an XSLT

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 setStylesheetPa ram(char* key, char* expression)).

The first argument to setStylesheetPa ram 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:

XPathParserExce ption: 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

Sep 21 '06 #1
2 2425
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).

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

Vaibhav

Sep 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
17357
by: zlatko | last post by:
There is a form in an Access Project (.adp, Access front end with SQL Server) for entering data into a table for temporary storing. Then, by clicking a botton, several action stored procedures (update, append) should be activated in order to transfer data to other tables. I tried to avoid any coding in VB, as I am not a professional, but I have found a statement in an article, that, unlike select queries, form's Input Property can't be...
3
38785
by: Michael Hertz | last post by:
I am performing a XSLT stylesheet on a XML document and produce a new XML document. How can I insert in this new XML stylesheet a tag <currtime>..."the current date/time"....</currtime> where "the current date/time" above is replaced by the real current time (e.g. 12th Sep 2004 09:23:78 Michael
2
4033
by: Craig Petrie | last post by:
The following transformation puzzles me when trying to transform XML to XML. I get an exception "THE EXPRESSION PASSED TO THIS METHOD SHOULD RESULT IN A NODESET" at the last line "xmlDoc.Load(xr)" when I run the code. I previously tried it all without a parameter and hard-coded the value into the 'apply-templates' statement and the tranform produced the result that I expected but when I inset the parameter I get the exception.
7
2868
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID parameter to the XSLT stylesheet XsltArgumentList xsltArgList = new XsltArgumentList(); xsltArgList.AddParam("pmID", "", pmID); xmlItems.TransformArgumentList = xsltArgList;
0
1678
by: stevag | last post by:
I have stored a variable ABC in a ASP.NET page and I use xsltArglist.AddParam in order to add this variable as a parameter to the binded XSLT transformation. In the associated .xslt file I use <xsl:param name="ABC"/> After declaring the parameter , I use it with <xsl:value-of select="$ABC"/> but in the resulting rendered page the value of the passing ABC parameter does not seem to appear. What is wrong?
2
2307
by: klaus | last post by:
Hello, I want to pass a parameter to an xslt using saxon on a windoes 2000 system. I'm using this command line in a batch file: java -jar c:\programme\saxon\saxon8.jar -v -novw -o ...\html_files\output.html ..\xml_files\input.xml ...\xslt\xml2html.xsl language=EN
6
2523
by: David Schwartz | last post by:
I have a template that searches for and replaces found instances of strings in other strings and replaces them with yet another string. These strings are passed to the template as parameters, not surprisingly. It so happens at the moment that I need to replace instances of spaces with a plus sign. Unfortunately, I don't know how to pass a space effectively, the template just doesn't get it. Any thoughts re how to fix this would be...
0
977
by: bluefootedpig | last post by:
hello, I'm wondering about passing in an xml file to an xslt document, i need need to querry the document for values. File1.xml <root> <address> ...data.... </address> </root>
2
1322
by: Peter Laman | last post by:
My XML data contains elements with a date attribute. I need to write an XSLT transformation that only selects the elements for the current month. Is that possible with XSLT only, or should I preselect the data a different way? Thanks
0
9587
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.