Saxon C version

Alex Grosu
2010-09-13
2012-10-08
  • Alex Grosu
    Alex Grosu
    2010-09-13

    Hi,

    I'm working on a project involving distributed C/C++ computing and XSLT2.0
    operations on a grid that doesn't support java. I've gave given up hope for
    the C++ version of Saxon and I hope there still is a way to do it by using
    plain old C. Are there any Saxon libraries written in C (or ideally C++)?

    Thank you,
    Alex

     
  • Michael Kay
    Michael Kay
    2010-09-13

    Sorry, you're out of luck. Saxon source code is 100% Java (except for a few
    modules that provide a C# API for .NET).

     
  • Alex Grosu
    Alex Grosu
    2010-09-13

    I guess I need to look for alternatives.
    Thank you for your answer. It was very fast.

    Alex

     
  • Alex,
    I don't know your situation, but I have been using MLJAM with MarkLogic. I
    need Michael Kay's Saxon for my stylesheets and extensions.

    It allows you to write java inside xQuery functions. There is a servlet that
    uses beanshell to compile the code and then returns.

    Anyway, I thought it might give you an idea of how to do this in your
    situation.

    Sincerely
    Tychicus

    http://developer.marklogic.com/learn/2006-05-mljam

     
  • Alex,
    I also found that there is a C version of Xalan.

    I don't know how up-to-date it is, but I did find it.

    -mike

     
  • Alex Grosu
    Alex Grosu
    2010-09-14

    Hi Mike,

    I need to use XLST2.0. The XML translation implies many functions and types
    specific to the 2.0 version of XSLT. I know of a C version of xalan, but is
    only compatible with the 1.0 version of XSLT.

    I googled a lot and always I find the same truth: officially, the XSLT 2.0 is
    supported only for java.

    Alex

     
  • Michael Kay
    Michael Kay
    2010-09-14

    I'm not sure what you mean by "officially". There are quite a few
    implementations of XSLT 2.0 now, but this isn't the place to discuss them.

     
  • David Lee
    David Lee
    2010-09-14

    As mentioned by Tychicus, an option ito run XSLT 2.0 transformations using
    Saxon is by a web service.
    Tychicus mentioned MLJAM which is MarkLogic specific.
    xmlsh has a servlet module which is not dependant on MarkLogic, ( But is
    dependent on tomcat and java).
    http://www.xmlsh.org/EmbeddingServlet

    I use this to run saxon xslt2 transformations in a system that is not java
    based naturally so uses a HTTP call to run the xslt.

    Another option is to use JNI to call into saxon from your C or C++ program.

     
  • Alex Grosu
    Alex Grosu
    2010-09-14

    The XSLT transform will apply to a high volume data ( half a million xml
    files, over 5GB total size) in a window of 30 minutes over a 100Mbps network.
    Will the HTTP be able to handle it?

     
  • David Lee
    David Lee
    2010-09-14

    I dont see why HTTP would be the bottleneck, but there may be many other
    things that are. For volume of that size I'd suggest "rolling your own"
    servelet so that it could take advantaged of advanced Saxon features such as
    pre-compiling the stylesheet, and definitely consider Saxon EE which can do
    some things in streaming mode as well as is more optimized.
    I suspect your volume requirements will definately be pushing the envelope but
    maybe it wont burst open :)
    But again I dont see why HTTP itself would be the bottleneck.

     
  • Michael Kay
    Michael Kay
    2010-09-14

    The XSLT transform will apply to a high volume data ( half a million xml
    files, over 5GB total size) in a window of 30 minutes over a 100Mbps network.
    Will the HTTP be able to handle it?

    I think that workload is not in the range where one could say "absolutely, no
    problem", nor is it in the range where one can say "not a hope, forget it". It
    needs detailed sizing.

     
  • daldei,
    I looked at xmlsh.

    Could I call this from MarkLogic xquery?

    From reading about xmlsh, I was not sure I could use this with MarkLogic.

    -mike

     
  • David Lee
    David Lee
    2010-09-14

    This is getting a bit off topic (but were still talking about saxon).
    Yes you can call this from MarkLogic, (via http post) I do it myself.
    For questions on xmlsh please contact me offline and I can send you some
    sample code.

    David Lee
    dlee@calldei.com