Java API
The Java API of RaptorXML+XBRL Server enables you to integrate the RaptorXML engine in applications written in Java. The API is implemented as a Java wrapper for Windows and Linux and provides access to RaptorXML+XBRL Server in order to validate documents and query their internal data model.
The Java API consists of the following components, which are available as noted below:
•Java library: Installed in the binaries folder of RaptorXML+XBRL Server, where all binaries are installed.
•Jni DLL/.so: also installed in the binaries folder.
•Examples: Installed in the examples/EngineAPI/java folder of RaptorXML+XBRL Server and can be downloaded from https://github.com/altova/RaptorXML-Examples. The examples show how to use XPath, XSLT, XQuery, and XBRL.
•JavaDoc Help:Available in the binaries folder of RaptorXML+XBRL Server as a ZIP archive, RaptorXMLServer_JavaDoc.zip or online at https://www.altova.com/manual/en/raptorapi/javaapiv2/2.11.1/html/index.html.
Note: The Java Engine API of RaptorXML+XBRL Server works with Java 17 or newer.
Compile and run an example project
To compile and run an example project as follows:
1.Copy the example folder to a user location.
2.On the command line, change directory to the example folder in the user location.
3.Compile the project with the following command: javac -d bin -cp "<Path_to_RaptorXML_API_Jar_file>" src\<Java_file_Name>
4.Run the project with the following command: java -cp "<Path_to_RaptorXML_API_Jar_file>;bin" -Djava.library.path="<RaptorXML_bin_folder>" <Java_Main_Class_Name> [<parameters>]
Example of Windows command line
1.xcopy "C:\Program Files\Altova\RaptorXMLXBRLServer2026\examples\EngineAPI\java\XQuery_ExternalFunction" /E C:\tmp\XQueryTest
2.cd C:\tmp\XQUeryTest
3.javac -d bin -cp "C:\Program Files\Altova\RaptorXMLXBRLServer2026\bin\raptorxmlxbrlapi.jar" src\XQuery_ExternalFunction.java
4.java -cp "C:\Program Files\Altova\RaptorXMLXBRLServer2026\bin\raptorxmlxbrlapi.jar;bin" -Djava.library.path="C:\Program Files\Altova\RaptorXMLXBRLServer2026\bin" XQuery_ExternalFunction
Example of Linux command line
1.cp -r /opt/Altova/RaptorXMLXBRLServer2026/examples/EngineAPI/java/XQuery_ExternalFunction ~/XQueryTest
2.cd ~/XQueryTest
3.javac -d bin -cp /opt/Altova/RaptorXMLXBRLServer2026/bin/raptorxmlxbrlapi.jar src/XQuery_ExternalFunction.java
4.sudo java -cp /opt/Altova/RaptorXMLXBRLServer2026/bin/raptorxmlxbrlapi.jar:bin -Djava.library.path=/opt/Altova/RaptorXMLXBRLServer2026/bin XQuery_ExternalFunction