src/main/java/eu/digitisation/layout/SortPageXML.java
private static List<String> readingOrder(Node node) throws IOException {
        NodeList children = node.getChildNodes();
        List<String> order = new ArrayList<String>();

        for (int n = 0; n < children.getLength(); ++n) {
            Node child = children.item(n);
            if (child instanceof Element
                    && child.getNodeName().equals("RegionRefIndexed")) {
                String index = ((Element) child).getAttribute("index");
                assert Integer.parseInt(index) == order.size();
                String idref = ((Element) child).getAttribute("regionRef");
                order.add(idref);
            }
        }
        return order;
    }
/**
     * Extract reading order as defined by an OrderedGroup element
     *
     * @param node node element
     * @return list of identifiers in reading order
     * @throws IOException
     */
Extract reading order as defined by an OrderedGroup element
@param node node element
@return list of identifiers in reading order
@throws IOException
Extract reading order as defined by an OrderedGroup element @param node node element @return list of identifiers in reading order @throws IOException
private static List<String> readingOrder(Node node) throws IOException {
        NodeList children = node.getChildNodes();
        List<String> order = new ArrayList<String>();
        for (int n = 0; n < children.getLength(); ++n) {
            Node child = children.item(n);
            if (child instanceof Element
                    && child.getNodeName().equals("RegionRefIndexed")) {
                String index = ((Element) child).getAttribute("index");
                assert Integer.parseInt(index) == order.size();
                String idref = ((Element) child).getAttribute("regionRef");
                order.add(idref);
            }
        }
        return order;
    }
private static List < String > readingOrder ( Node node ) throws IOException { NodeList children = node . getChildNodes ( ) ; List < String > order = new ArrayList < String > ( ) ; for ( int n = 0 ; n < children . getLength ( ) ; ++ n ) { Node child = children . item ( n ) ; if ( child instanceof Element && child . getNodeName ( ) . equals ( "RegionRefIndexed" ) ) { String index = ( ( Element ) child ) . getAttribute ( "index" ) ; assert Integer . parseInt ( index ) == order . size ( ) ; String idref = ( ( Element ) child ) . getAttribute ( "regionRef" ) ; order . add ( idref ) ; } } return order ; }
Extract reading order as defined by an OrderedGroup element
 @param node node element
 @return list of identifiers in reading order
 @throws IOException
Extract reading order as defined by an OrderedGroup element @param node node element @return list of identifiers in reading order @throws IOException