Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

151
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda