Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

Ram Korutla
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have put the below schema defintion and

<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:rm="OTC_RM_Rates_4-0"
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
/xmls/OTC/soap-envelope.xsd /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.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic