Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3674964
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:55:05+00:00 2026-05-19T02:55:05+00:00

HI, I am using Xalan to parse my xsl file. The xsl is working

  • 0

HI, I am using Xalan to parse my xsl file. The xsl is working properly in the vb.net parsers. But Xalan gives error for that xsl.

For extension function, could not find
method
java.lang.String.FctDateDuration([ExpressionContext,]
STRING).

Here is how I have define my xsl.

xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:ttVB="ttVB" exclude-result

Here is the java script calling part in xsl : –

<xsl:variable name="start">
      xsl:value-of select="substring(DepartureDateTime,1,10)" />
     </xsl:variable>
     xsl:variable name="end">
     xsl:value-of select="substring(following-sibling::OriginDestinationInformation/DepartureDateTime,1,10)" />
     </xsl:variable>
     xsl:variable name="end1">
      xsl:value-of select="substring(preceding-sibling::OriginDestinationInformation/DepartureDateTime,1,10)" />
     </xsl:variable>
     xsl:variable name="dd" select="ttVB:FctDateDuration(string('2011-02-20'),string('2011-02-25'))"/>
     xsl:variable name="dd1" select="ttVB:FctDateDuration(string('2011-02-20'),string('2011-02-25'))"/>
     <xsl:choose>
      xsl:when test="$dd = 0 or $dd = 1">
       <timeQualifier>TA</timeQualifier>
      </xsl:when>
      xsl:otherwise>
       timeQualifier>TD</timeQualifier>
      </xsl:otherwise>
     </xsl:choose>

Here is my Javascript

<msxsl:script language="JavaScript" implements-prefix="ttVB">
<![CDATA[

function FctDateDuration(p_startDate,p_endDate){



    if (IsDate(p_startDate) && IsDate(p_endDate)){

        FctDateDuration = String(calcDays(p_startDate, p_endDate)) 

    }else{

        FctDateDuration = p_startDate + p_endDate

    }



return FctDateDuration;

}



function IsDate(ddate){



//alert("Inside IsDate >> "+ddate);

var dteDate;



var year = ddate.substring(0, 4);

var month = ddate.substring(5, 7);

var day = ddate.substring(8,10);



month = month-1;



//alert(year);

//alert(month);

//alert(day);



dteDate=new Date(year,month,day);





return ((day==dteDate.getDate()) && (month==dteDate.getMonth()) && (year==dteDate.getFullYear()));





}



function calcDays(date1,date2){

  date1 = date1.split("-");

  date2 = date2.split("-");

  var sDate = new Date(date1[0]+"/"+date1[1]+"/"+date1[2]);

  var eDate = new Date(date2[0]+"/"+date2[1]+"/"+date2[2]);

  var daysApart = Math.abs(Math.round((sDate-eDate)/86400000));

  //document.getElementById('diffDays').lastChild.data = daysApart;



//alert(daysApart);

return daysApart;



}





]]>

</msxsl:script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:55:06+00:00Added an answer on May 19, 2026 at 2:55 am

    Well extension functions are hardly portable, not even the way they are defined is portable. With .NET you can use the msxsl:script element to define extension functions but don’t expect Xalan to support that. According to http://xml.apache.org/xalan-j/extensions.html#ex-basic Xalan Java supports a xalan:script element if you put bsf.jar and js.jar on the classpath.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using ASP.NET MVC there are situations (such as form submission) that may require a
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
I've been using the Xalan XSLT processor in Eclipse STS 3.7, but I recently
Using an Document DTD I did the following: file.xsl: <!DOCTYPE xsl:stylesheet[ <!ENTITY red rgb(255,0,0)>
I'm using xalan with the following xsl header: <xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform version=1.0 xmlns:redirect=http://xml.apache.org/xalan/redirect extension-element-prefixes=redirect xmlns:xalan=http://xml.apache.org/xalan>
I am attempting to transform some Docbook XSL to HTML using Java / Xalan
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using VS2008, C#, .Net 2 and Winforms how can I make a regular Button
Using C#, I need a class called User that has a username, password, active
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.