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 7730207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:09:59+00:00 2026-06-01T06:09:59+00:00

I’m trying to use the Saxon processor from java. I’m using the the saxon9ee.jar

  • 0

I’m trying to use the Saxon processor from java. I’m using the the saxon9ee.jar inside saxonee9-3-0-11j.zip (just downloaded, no license – is that needed so it’ll work?)

Their ** resources can be found here:
http://www.saxonica.com/documentation/extensibility/functions/instance-methods.xml

http://www.saxonica.com/documentation/extensibility/functions/staticmethods.xml

My xsl:

<?xml version="1.0"?>
<xsl:stylesheet 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
version="1.0">

    <xsl:template match="/">  
        <xsl:value-of select="dateUtils:getCurrentFullDate()" 
              xmlns:dateUtils="java:com.macfaq.math.SimpleSaxon"/>
    </xsl:template>

</xsl:stylesheet>

My java file:

package com.macfaq.math;
public class SimpleSaxon {
public static final String YMDTHMS = "yyyyMMdd'T'hhmmss";
    public static String getCurrentFullDate() {
        return (new SimpleDateFormat(YMDTHMS).format(new Date()));
    }

}

My input XML file:

<?xml version="1.0" encoding="UTF-8"?>
<date format="yyyyMMdd'T'hhmmss" year="2000" month="4" day="27"/>

My main java file:

public class SaxonTransf {

public static void main(String[] args) {

    System.setProperty("javax.xml.transform.TransformerFactory",
            "net.sf.saxon.TransformerFactoryImpl");
    String foo_xml = "in.xml"; // input xml
    String foo_xsl = "transf.xsl"; // input xsl

    TransformerFactory tfactory = TransformerFactory.newInstance();
    Transformer transformer = tfactory.newTransformer(new StreamSource(
            new File(foo_xsl)));
    transformer.transform(new StreamSource(new File(foo_xml)), 
        new StreamResult(System.out));

}

Error:
XTDE1425: Cannot find a matching 0-argument function named
{java:com.macfaq.math.SimpleSaxon}getCurrentFullDate(). The namespace URI and local name
are recognized, but the number of arguments is wrong in built-in template rule.

Has anyone had any luck with calling custom java functions from XSL while using this wonderful processor?

  • 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-06-01T06:10:00+00:00Added an answer on June 1, 2026 at 6:10 am

    When you run Saxon using the Saxon-EE JAR file but with no license, then (in theory at least) it should behave exactly like Saxon-HE, which means this style of extension function call is not supported.

    If you’re running from the command line, the -TJ option will give you more detailed diagnostics detailing the search for a matching function.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have thousands of HTML files to process using Groovy/Java and I need to
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text

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.