The net.sf.saxon.Transform command line doesn't use JAXP to instantiate the transformation engine, so the system property setting will have no effect.

I would suggest writing a class that subclasses net.sf.saxon.Transform, which you then invoke from the command line in place of net.sf.saxon.Transform. There are several "hooks" in the code that are designed to allow a subclass to customize the behaviour, for example by setting Configuration properties. It's probably worth looking at the source code to discover how best to exploit these.

Michael Kay
Saxonica



On 26/10/2010 16:26, Bernhard Wagner wrote:

I'm trying to invoke saxon as an xslt processor with a custom extension function from the commandline:

java \
  -Djavax.xml.transform.TransformerFactory=testing.saxon.MyTransFact \
  -cp saxon9he.jar:. \
  net.sf.saxon.Transform \
  -s:extFunc.xml \
  -xsl:extFunc.xsl

I'm using my own MyTransFact to plug in my custom extension.

However, my custom TransformerFactory doesn't seem to be picked up.

My questions:
1. Is the system property "javax.xml.transform.TransformerFactory" ignored when using net.sf.saxon.Transform? I'd really like to use net.sf.saxon.Transform because of its rich set of command line options.

2. Are there better ways to plug in my custom extension function?
(I'm bound to saxon HE, thus I'm limited to explicit registration
 of my extension function)

I'm using saxon 9 HE (9.2.1.1), java version "1.6.0_22" on ubuntu Linux.

Thanks
Bernhard
------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help