Project

Profile

Help

Compile source code with newer IKVM version

Added by Mustafa Kerim Yılmaz over 10 years ago

I am using IKVM for converting another java application to C#. I try my java application with IKVM 0.46.4.2, but not working. So I try to compile saxon9he 9.5.1.4 with IKVM 7.2. saxon9he 9.5.1.4 source can not has net.sf.saxon.dotnet package. I got it from older version: 9.5.0.1. I can compile jar successfully, also I can compile Saxon.Api. When I try to transofrom something it gives error in Configuration.cs in this function:

    public XmlResolver XmlResolver
    {
        get
        {
            return ((DotNetURIResolver)config.getURIResolver()).getXmlResolver();  // 'net.sf.saxon.lib.StandardURIResolver' cannor convert to 'net.sf.saxon.dotnet.DotNetURIResolver'
        }
        set
        {
            config.setURIResolver(new DotNetURIResolver(value));
        }
    }

What can I do? Thanks.


Replies (5)

Please register to reply

RE: Compile source code with newer IKVM version - Added by O'Neil Delpratt over 10 years ago

Hi Mustafa,

The Saxon-HE source code on sourceforge is for building Saxon on Java platform. Therefore it does not include the dotnet package. We tried to build Saxon using IKVM 7.2 but came across a few stumbling blocks. It has been such a long time that the details I cannot recall. However, we hope revisit the IKVM 7 issues soon.

You can build the jar from source for the .NET platform by using our supplied ant build scripts. See build files in the svn repository:

https://dev.saxonica.com/repos/archive/opensource/latest9.5/build/

I would think running the command @'ant jar-hen'@ will suffice. The setup to building Saxon from source is not an easy process. You will need the preprocess jar file jcp-5.3.jar (which you can get from http://code.google.com/p/java-comment-preprocessor/).

You will also need ant-ikvmc.0.5.jar.

You should be able to comment out the ant tasks that don't apply to you. For example, Saxon-EE/PE related tasks and dll build tasks, etc.

I hope this helps?

RE: Compile source code with newer IKVM version - Added by Mustafa Kerim Yılmaz over 10 years ago

Hi O'Neil Delpratt,

I try it and I will write back here my experience here. Thanks.

RE: Compile source code with newer IKVM version - Added by Mustafa Kerim Yılmaz over 10 years ago

Hi O'Neil Delpratt,

I try build with ant script, but it gives class not found error for com.sf.saxon.* Also it gives symbol not found errors like DotNetPlatformPE. I can build jar file for .net successfully, so I try run ikvmc directly:

ikvmc -target:library -version:1.0.0.1 -keyfile:my.snk -reference:mscorlib.dll -reference:system.dll -reference:system.xml.dll saxon9he.jar xml-resolver-1.2.jar xerces-1.4.3.jar

I made little test for trasform, it's like working.

Thanks a lot.

RE: Compile source code with newer IKVM version - Added by O'Neil Delpratt over 10 years ago

Mustafa Kerim Yılmaz wrote:

Hi O'Neil Delpratt,

I try build with ant script, but it gives class not found error for com.sf.saxon.* Also it gives symbol not found errors like DotNetPlatformPE.

As expected the EE code is not available. You can always remove the EE related tasks from the ant build.

I can build jar file for .net successfully, so I try run ikvmc directly:

ikvmc -target:library -version:1.0.0.1 -keyfile:my.snk -reference:mscorlib.dll -reference:system.dll -reference:system.xml.dll saxon9he.jar xml-resolver-1.2.jar xerces-1.4.3.jar

I made little test for trasform, it's like working.

Thanks a lot.

No problem. Glad that you got it to work

    (1-5/5)

    Please register to reply