Package hu.jokeman.xparser.document

Examples of hu.jokeman.xparser.document.XMLNodeIterator


    }
   
    public void visit (XMLElement anElement) {
        _pp.print ("<" + anElement.getName ());

        XMLNodeIterator nodeIt = anElement.children ();
        int attrCount = 0;
        while (nodeIt.hasNext ()) {
            XMLNode child = nodeIt.next ();
            if (child instanceof XMLAttribute) {
                child.accept (this);
                attrCount++;
            }
        }

        if (attrCount == anElement.childCount ()) {
            _pp.printSimple (" />\n");
        } else {
            _pp.printSimple (">\n");
            _pp.inc ();
            nodeIt = anElement.children ();
            while (nodeIt.hasNext ()) {
                XMLNode child = nodeIt.next ();
                if (!(child instanceof XMLAttribute)) {
                    child.accept (this);
                }
            }
            _pp.pop ();
View Full Code Here


        }
    }
   
    public void visit (XMLProcessingInstruction aProcessingInstruction) {
        _pp.print ("<?" + aProcessingInstruction.getName ());
        XMLNodeIterator nodeIt = aProcessingInstruction.children ();
        while (nodeIt.hasNext ()) {
            nodeIt.next ().accept (this);
        }
        _pp.printSimple (" ?>\n");
    }
View Full Code Here

import hu.jokeman.xparser.document.XMLNodeVisitor;

public abstract class AbstractVisitor implements XMLNodeVisitor {

    protected void visitChildren (XMLNode aNode) {
        XMLNodeIterator nodeIt = aNode.children ();
        while (nodeIt.hasNext ()) {
            nodeIt.next ().accept (this);
        }
    }
View Full Code Here

   
    public void visit (XMLElement anElement) {
        visitChildren (anElement);
       
        LinkedList<XMLNode> childrenToRemove = new LinkedList<XMLNode> ();
        XMLNodeIterator nodeIt = anElement.children ();
        while (nodeIt.hasNext ()) {
            XMLNode child = nodeIt.next ();
            if ((child instanceof XMLCData) &&
                    (((XMLCData) child).getContent ().length () == 0)) {
                childrenToRemove.add (child);
            }
        }
View Full Code Here

        StringBuffer buf = new StringBuffer ();
        _pp.print (appendCode (buf, XMLNodeColor.Element,
                    "&lt;" + anElement.getName ()).toString ());

        // attrib�tumok kiirat�sa �s megsz�mol�sa
        XMLNodeIterator nodeIt = anElement.children ();
        int attrCount = 0;
        while (nodeIt.hasNext ()) {
            XMLNode child = nodeIt.next ();
            if (child instanceof XMLAttribute ) {
                child.accept (this);
                attrCount++;
            }
        }

        // gyermek elemek kiirat�sa - ha vannak
        buf = new StringBuffer ();
        if (attrCount == anElement.childCount ()) {
            _pp.printSimple (appendCode (buf, XMLNodeColor.Element,
                        " /&gt;").toString () + "\n");
        } else {
            _pp.printSimple (appendCode (buf, XMLNodeColor.Element,
                        "&gt;").toString () + "\n");
            _pp.inc ();

            nodeIt = anElement.children ();
            while (nodeIt.hasNext ()) {
                XMLNode child = nodeIt.next ();
                if (!(child instanceof XMLAttribute)) {
                    child.accept (this);
                }
            }
           
View Full Code Here

        StringBuffer buf = new StringBuffer ();
        _pp.print (appendCode (buf, XMLNodeColor.PI,
                "&lt;?" + aProcessingInstruction.getName ()).toString ());
       
        // attrib�tumok kiirat�sa
        XMLNodeIterator nodeIt = aProcessingInstruction.children ();
        while (nodeIt.hasNext ()) {
            XMLNode child = nodeIt.next ();
            if (child instanceof XMLAttribute) {
                child.accept (this);
            }
        }
View Full Code Here

TOP

Related Classes of hu.jokeman.xparser.document.XMLNodeIterator

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.