Parsing very large XML documents (and a bit more) in java

后端 未结 6 777
青春惊慌失措
青春惊慌失措 2020-11-30 05:56

(All of the following is to be written in Java)

I have to build an application that will take as input XML documents that are, potentially, very large. The document

6条回答
  •  死守一世寂寞
    2020-11-30 06:39

    I would write a custom implementation of InputStream that decrypts the bytes in the file and then use SAX to parse the resulting XML as it comes off the stream.

    SAXParserFactory.newInstance().newSAXParser().parse(
      new DecryptingInputStream(), 
      new MyHandler()
    );
    

提交回复
热议问题