basex 6.3.2 and .NET
Monday, 22 November 2010 · 4 messages · last reply 23 Nov 2010
MG
Maximilian Gärber22 Nov 2010 22:01 #
Hi all,
I did some testing with IKVM and basex-6.3.2.jar and it turns out to be as simple as calling ikvmc on the .jar file to get a working basex-6.3.2.dll for .NET
I adapted the DB example from
http://www.inf.uni-konstanz.de/dbis/basex/code/DatabaseExample an it run without problems.
Now I am curious what others have experienced using basex on .NET. And of course: what are chances that this could be supported in the future (like Saxon.net, for example)
Best Regards,
Maximilian
DG
Dave Glick22 Nov 2010 23:14 #
Maximilian,
We use it extensively, though we've spent a large amount of effort "wrapping" BaseX in native .NET interfaces. There are several complications to using it "out of the box". One of the trickiest is that even though IL accepts methods and fields with the same name as is common in Java, none of the .NET compilers will resolve those calls and will treat them as ambiguous. This pops up in several places and makes it difficult/impossible to use. Our solution was to create a post-IKVM process where we use Cecil to find and the rewrite the IL where this occurs. You could also just change the Java before compiling with IKVM, but that might create a maintenance headache. We also needed to integrate BaseX with Saxon in order to run XSLT. To do so we created custom implementations of the DOM objects in System.Xml (such as XmlDocument, XmlNode, XmlElement, etc.). We can then feed these into any other library that expects System.Xml objects. We've also created our own set of objects through which we access all BaseX functionality (so we're never calling BaseX Java code directly except through the wrapper). This makes it much easier to use from other applications.
In short, it can be an uphill battle, but it works very, very well once you work out the kinks. We're running BaseX successfully in a 100% native .NET environment on Mono on Windows, Linux, and Solaris with great results (it works well under the Microsoft CLR too). We've considered offering our wrapper as a commercial product once we get around to gauging interest, writing documentation, etc., but that probably won't be for several more months if at all.
Dave
Quoted text · basex-talk-bounces at mailman.uni-konstanz.de · 10 lines
From: basex-talk-bounces at mailman.uni-konstanz.de [mailto:basex-talk-bounces at mailman.uni-konstanz.de] On Behalf Of Maximilian Gärber Sent: Monday, November 22, 2010 4:02 PM To: basex-talk at mailman.uni-konstanz.de Subject: [basex-talk] basex 6.3.2 and .NET Hi all, I did some testing with IKVM and basex-6.3.2.jar and it turns out to be as simple as calling ikvmc on the .jar file to get a working basex-6.3.2.dll for .NET I adapted the DB example from http://www.inf.uni-konstanz.de/dbis/basex/code/DatabaseExample an it run without problems. Now I am curious what others have experienced using basex on .NET. And of course: what are chances that this could be supported in the future (like Saxon.net, for example) Best Regards, Maximilian
MG
Maximilian Gärber23 Nov 2010 11:18 #
Hi Dave,
looks like it's not as easy as it seemed first... thank you for the pointers!
Would it be possible for you to provide a list of those ambiguous method/field names? If it doesn't affect the APIs too much, maybe the basex developers would take those conflicts into account regarding naming conventions?
Best,
Maximilian
2010/11/22 Dave Glick <dglick at dracorp.com>
Quoted text · Dave Glick · 18 lines
> > Maximilian, > > We use it extensively, though we’ve spent a large amount of effort “wrapping” BaseX in native .NET interfaces. There are several complications to using it “out of the box”. One of the trickiest is that even though IL accepts methods and fields with the same name as is common in Java, none of the .NET compilers will resolve those calls and will treat them as ambiguous. This pops up in several places and makes it difficult/impossible to use. Our solution was to create a post-IKVM process where we use Cecil to find and the rewrite the IL where this occurs. You could also just change the Java before compiling with IKVM, but that might create a maintenance headache. We also needed to integrate BaseX with Saxon in order to run XSLT. To do so we created custom implementations of the DOM objects in System.Xml (such as XmlDocument, XmlNode, XmlElement, etc.). We can then feed these into any other library that expects System.Xml objects. We’ve also created our own set of objects through which we access all BaseX functionality (so we’re never calling BaseX Java code directly except through the wrapper). This makes it much easier to use from other applications. > > In short, it can be an uphill battle, but it works very, very well once you work out the kinks. We’re running BaseX successfully in a 100% native .NET environment on Mono on Windows, Linux, and Solaris with great results (it works well under the Microsoft CLR too). We’ve considered offering our wrapper as a commercial product once we get around to gauging interest, writing documentation, etc., but that probably won’t be for several more months if at all. > > Dave > > From: basex-talk-bounces at mailman.uni-konstanz.de [mailto:basex-talk-bounces at mailman.uni-konstanz.de] On Behalf Of Maximilian Gärber > Sent: Monday, November 22, 2010 4:02 PM > To: basex-talk at mailman.uni-konstanz.de > Subject: [basex-talk] basex 6.3.2 and .NET > > Hi all, > I did some testing with IKVM and basex-6.3.2.jar and it turns out to be as simple as calling ikvmc on the .jar file to get a working basex-6.3.2.dll for .NET > I adapted the DB example from http://www.inf.uni-konstanz.de/dbis/basex/code/DatabaseExample an it run without problems. > Now I am curious what others have experienced using basex on .NET. And of course: what are chances that this could be supported in the future (like Saxon.net, for example)
CG
Christian Grün23 Nov 2010 19:33 #
Hi Maximilian, hi Dave,
we frequently get requests for a .net version of BaseX, and IKVM would be our favorite choice. Currently, we clearly don't have the human resources to look deeper into this; this is why, some time ago, we've also pondered to make it an commercial option.
Still, we are always interested in hints how a future conversion could be simplified.
Christian
Quoted text · Maximilian Gärber · 40 lines
On Tue, Nov 23, 2010 at 11:18 AM, Maximilian Gärber <mgaerber at arcor.de> wrote: > Hi Dave, > > looks like it's not as easy as it seemed first... thank you for the pointers! > > Would it be possible for you to provide a list of those ambiguous > method/field names? If it doesn't affect the APIs too much, maybe the > basex developers would take those conflicts into account regarding > naming conventions? > > Best, > > Maximilian > > > 2010/11/22 Dave Glick <dglick at dracorp.com> >> >> Maximilian, >> >> We use it extensively, though we’ve spent a large amount of effort “wrapping” BaseX in native .NET interfaces. There are several complications to using it “out of the box”. One of the trickiest is that even though IL accepts methods and fields with the same name as is common in Java, none of the .NET compilers will resolve those calls and will treat them as ambiguous. This pops up in several places and makes it difficult/impossible to use. Our solution was to create a post-IKVM process where we use Cecil to find and the rewrite the IL where this occurs. You could also just change the Java before compiling with IKVM, but that might create a maintenance headache. We also needed to integrate BaseX with Saxon in order to run XSLT. To do so we created custom implementations of the DOM objects in System.Xml (such as XmlDocument, XmlNode, XmlElement, etc.). We can then feed these into any other library that expects System.Xml objects. We’ve also created our own set of objects through which we access all BaseX functionality (so we’re never calling BaseX Java code directly except through the wrapper). This makes it much easier to use from other applications. >> >> In short, it can be an uphill battle, but it works very, very well once you work out the kinks. We’re running BaseX successfully in a 100% native .NET environment on Mono on Windows, Linux, and Solaris with great results (it works well under the Microsoft CLR too). We’ve considered offering our wrapper as a commercial product once we get around to gauging interest, writing documentation, etc., but that probably won’t be for several more months if at all. >> >> Dave >> > >> From: basex-talk-bounces at mailman.uni-konstanz.de [mailto:basex-talk-bounces at mailman.uni-konstanz.de] On Behalf Of Maximilian Gärber >> Sent: Monday, November 22, 2010 4:02 PM >> To: basex-talk at mailman.uni-konstanz.de >> Subject: [basex-talk] basex 6.3.2 and .NET >> >> Hi all, >> I did some testing with IKVM and basex-6.3.2.jar and it turns out to be as simple as calling ikvmc on the .jar file to get a working basex-6.3.2.dll for .NET >> I adapted the DB example from http://www.inf.uni-konstanz.de/dbis/basex/code/DatabaseExample an it run without problems. >> Now I am curious what others have experienced using basex on .NET. And of course: what are chances that this could be supported in the future (like Saxon.net, for example) > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
Written for BaseX 6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery