Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

147
Views
Convert EXI binary data to XML/JSON and viceversa

TL;DR

What is the best way to use exificient-grammar to generate a GRS file from a XSD, that can be used with exificient-for-javascript?

--

I am developing a TCP server with Nodejs. The clients send data in EXI format. I have the XSD schemas and I would like to convert those bytes, in EXI format, to JSON or similar.

To work with exificient-for-javascript I need to generate the GRS file with the exificient-grammars library. I have never worked with Java, but I understand that this library does not have a CLI executable, but you can import it in your project and use it. I have tried to create a java project and using maven I am loading the libraries. I manage to run the project but my little knowledge of Java is making me lose a lot of time with this. In short I am not able to generate the GRS file. My java code (see comment "and now, how to..."):

public class Parser {
    Grammars grammar;

    public void parse() {
        System.out.println("Hello from parser");
        try {
            grammar = GrammarFactory.newInstance().createGrammars("VALID_ABSOLUTE_SYSTEM_PATH_TO_XSD");
            // and now, how to generate an output GRS file???
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
}

On the other hand, the exificient project does provide an executable to convert EXI to XML and vice versa, however in my Nodejs application I get a buffer (an array of int8). It occurs to me that I could generate a binary file from Nodejs and process it with the exificient executable in the background (exec/spawn), but this seems a bit overkill to me.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The class Grammars2JSON is what you are looking for.

This class can be called from the command line by passing the XSD as input. It creates the according JSON grammars file.

see https://github.com/EXIficient/exificient-grammars/blob/master/src/main/java/com/siemens/ct/exi/grammars/persistency/Grammars2JSON.java#L658

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!