This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Error while using xs:dateTime in an XSL and transforming it using a Java program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Error while using xs:dateTime in an XSL and transforming it using a Java program" Watch "Error while using xs:dateTime in an XSL and transforming it using a Java program" New topic
Author

Error while using xs:dateTime in an XSL and transforming it using a Java program

Ram Korutla
Ranch Hand

Joined: Dec 24, 2007
Posts: 80
Hi

I have put the below schema defintion and

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rm="OTC_RM_Rates_4-0"
xmlns:mtc="OTC_Matching_Rates_4-0"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:fpml="http://www.fpml.org/2007/FpML-4-3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2004/XMLSchema"
xsi:schemaLocation=" OTC_RM_Rates_4-0 /xmls/OTC/OTC_RM_Rates_4-0.xsd OTC_Matching_Rates_4-0 /xmls/OTC/OTC_Matching_Rates_4-0.xsd http://schemas.xmlsoap.org/soap/envelope/
/xmls/OTC/soap-envelope.xsd http://www.fpml.org/2007/FpML-4-3 /xmls/OTC/fpml-main-4-3.xsd">

and I am trying to get "Year" from a variable $field that stores the date in some other format as in below

<xsl:value-of select="year-from-dateTime(xs:dateTime($field))"/>


While running the Java program that transforms this xsl, I am getting the below error.

"The first argument to the non-static Java function 'dateTime' is not a valid object reference"

I am very novice to the schema etc and as luck would have it I have to work this some how.

Any help would be greatly appreciated.



Thanks
Phani
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error while using xs:dateTime in an XSL and transforming it using a Java program
 
Similar Threads
HTTPS URL in XSD Schema validation
Validating a SOAP document using XSD
Why do I see different wsdl and xsd generated for webservice through wsgen.
DST issue with GregorianCalendar
org.w3c.dom.DOMException: DOM003 Namespace error