-1

I have some .rdl files with me. I want to if there is any specific java API to parse. I searched over the internet but could not find.

Please suggest.

1 Answers1

0

It depends what you want to do with the .RDL file I suppose. If you are interested in parsing the content and then performing your own operations on the result, then you can treat it as standard XML. For example:

private void parseRdlFile(String filePath) {
    File rdlFile = new File(filePath);
    DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder dBuilder;
    Document doc;
    try {
        dBuilder = dbFactory.newDocumentBuilder();
        doc = dBuilder.parse(rdlFile);
        System.out.println("Root:" + doc.getDocumentElement().getNodeName());
    } catch (SAXException | IOException | ParserConfigurationException e) {
        LOG.error("Error parsing", e);
    }
}

This just parses the file using a DOM parser and prints out the value of the root node. Take a look at parsing XML with DOM and SAX parsing approaches.

PA001
  • 451
  • 3
  • 12