Package org.geotools.xml

Examples of org.geotools.xml.Text


    }
   
    public void collapseWhitespace() {
        //leading whitespace
        for (Iterator<Node> it = ((List<Node>)children).iterator(); it.hasNext();) {
            Text t = text(it.next());
            if (t == null) break;
           
            if (t.isWhitespace()) {
                it.remove();
            }
            else {
                t.trimLeading();
                break;
            }
        }
       
        //trailing whitespace
        for (int i = children.size()-1; i > -1; i--) {
            Text t = text((Node) children.get(i));
            if (t == null) break;
           
            if (t.isWhitespace()) {
                children.remove(i);
            }
            else {
                t.trimTrailing();
                break;
            }
        }
       
        //inner whitespace
        boolean remove = false;
        for (Iterator<Node> it = ((List<Node>)children).iterator(); it.hasNext();) {
            Text t = text(it.next());
            if (t == null) continue;
           
            t.trimInner();
            if (t.isWhitespace()) {
                if (remove) {
                    it.remove();
                }
                else {
                    remove = true;
View Full Code Here


        //simply add the text to the element
        element.addText(ch, start, length);
       
        if (isMixed()) {
            String text = new String(ch, start, length);
            node.addChild(new NodeImpl(TextInstance.INSTANCE, new Text(text)));   
        }
    }
View Full Code Here

TOP

Related Classes of org.geotools.xml.Text

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.