Skip to content
This repository has been archived by the owner on Dec 18, 2022. It is now read-only.

murphye/saxon-graalvm-native-from-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Saxon GraalVM Native Image called from C++

The purpose of this repository is to show a proof of concept on how to use the Saxon XSLT engine from C++, without using the Saxon C distribution. This is possible through GraalVM Native Image which allows the creation of a shared library (.so) containing a nativly compiled version of your Java function.

Getting Started

Examine and run thefull_build.sh that will build the Saxon native library, build the C++ executable application, and run it.

Typical Result (XML to JSON)

./transform
Result> [{"Item_Number":"20001","Item_Description":"Item Description 1"},{"Item_Number":"20002","Item_Description":"Item Description 2"},{"Item_Number":"20003","Item_Description":"Item Description 3"}]
2892

Credits

  1. Code in Java, Execute as C++
  2. klakegg/docker-saxon
  3. GraalVM Build a Shared Library
  4. How to call a Java entrypoint method with non-primitive types as parameters from C++ using GraalVM