Skip to content

Instantly share code, notes, and snippets.

@HashRaygoza
Created February 18, 2021 06:16
Show Gist options
  • Save HashRaygoza/3aaf0e2313afdf6e08e94dc247b92588 to your computer and use it in GitHub Desktop.
Save HashRaygoza/3aaf0e2313afdf6e08e94dc247b92588 to your computer and use it in GitHub Desktop.
package mx.hash.xml2json;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
import org.xml.sax.SAXException;
public class App {
static public void main(String[] args) {
try {
// Ruta del archivo XML
String nombreArchivo = "A-2.xml";
ConversorJSON conversor = new ConversorJSON();
String json = conversor.convertir(nombreArchivo);
System.out.println(json);
} catch (ParserConfigurationException | SAXException | IOException | TransformerException ex) {
Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment