1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
        XMLReader r = new XMLReader();
        r.addHandler("row"new NodeHandler() {        
             
            @Override
            public void process(StructuredNode node)  {
                try {
                    count = count+1;
                    String[] dataChild = new String[collength];
                    
                    for(int k=1; k < collength +1; k++) {
                        if(!node.isEmpty("c" + k)){
                            dataChild[k-1= node.queryString("c"+ k);
                        }else{
                            dataChild[k-1= getNodeValue(node, k, path, xs.getLobList());
                        }
                    }
                } catch(Exception e){
                    e.printStackTrace();
                }
            }
        });
        r.parse(new FileInputStream(xmlfilepath));

참고

http://andreas.haufler.info/2012/01/conveniently-processing-large-xml-files.html

 

Conveniently Processing Large XML Files with Java

When processing XML data I find it most convenient to load the whole document using a DOM parser and fire some XPath-queries against the re...

andreas.haufler.info

GitHub

https://github.com/andyHa/scireumOpen/tree/master/src/com/scireum/open

 

andyHa/scireumOpen

DEPRECATED: See scireum/sirius. Contribute to andyHa/scireumOpen development by creating an account on GitHub.

github.com

XSD 스키마 분석 참고

https://stackoverflow.com/questions/8282578/in-java-how-do-i-parse-an-xml-schema-xsd-to-learn-whats-valid-at-a-given-ele?rq=1