Code example for Document

Methods: getDocumentElement

0
     */ 
    public LayoutAnalysis analyze(String name, Document document) {
        LayoutAnalysis analysis = new LayoutAnalysis(name);
 
        try { 
            Element root = document.getDocumentElement();
            analyze(analysis, root);
        } finally { 
            analysis.validate();
        } 
 
        return analysis;        
    } 
 
    private void analyze(LayoutAnalysis analysis, Node node) {
        NodeList list = node.getChildNodes();
        int count = list.getLength();
 
        applyRules(analysis, node);
 
        for (int i = 0; i < count; i++) {