Package hu.jokeman.xparser.document

Examples of hu.jokeman.xparser.document.XMLNode.addChild()


    public void addCData (String content) throws DocumentBuilderException {
        XMLNode currentNode = peek ();
        if (currentNode instanceof Document ||
                currentNode instanceof Element) {
           
            currentNode.addChild (new CData (content));
        } else {
            throw new DocumentBuilderException ("CData isn't allowed here.");
        }
    }
View Full Code Here


    }

    public void addDocType (String docType) throws DocumentBuilderException {
        XMLNode currentNode = peek ();
        if (currentNode instanceof Document) {
            currentNode.addChild (new DocType (docType));
        } else {
            throw new DocumentBuilderException (
                    "Document schema definitions aren't allowed here.");
        }
    }
View Full Code Here

    public void createProcessingInstructionStart (String piName)
            throws DocumentBuilderException {
        XMLNode currentNode = peek ();
        if (currentNode instanceof Document) {
            ProcessingInstruction pi = new ProcessingInstruction (piName);
            currentNode.addChild (pi);
            push (pi);
        } else {
            throw new DocumentBuilderException (
                    "Document schema definitions aren't allowed here.");
        }
View Full Code Here

    public void createTagStart (String tagName) throws DocumentBuilderException {
        XMLNode currentNode = peek ();
        if (currentNode instanceof Document ||
                currentNode instanceof Element) {
            Element element = new Element (tagName);
            currentNode.addChild (element);
            push (element);
        } else {
            throw new DocumentBuilderException (
                    "Elements not allowed here.");
        }
View Full Code Here

        XMLNode currentNode = peek ();
        if (currentNode instanceof Element ||
                currentNode instanceof ProcessingInstruction) {
            Attribute attr = new Attribute (attrName);
            attr.setValue (attrVal);
            currentNode.addChild (attr);
        } else {
            throw new DocumentBuilderException (
                    "Attributes not allowed here.");
        }
    }
View Full Code Here

    public void addEntityReference (String entityName)
            throws DocumentBuilderException {
        XMLNode currentNode = peek ();
        if (currentNode instanceof Element) {
            currentNode.addChild (new EntityReference (entityName));
        } else {
            throw new DocumentBuilderException (
                    "Entity references not allowed here.");
        }
    }
View Full Code Here

    public void addComment (String content) throws DocumentBuilderException {
        XMLNode currentNode = peek ();
        if (currentNode instanceof Element ||
                currentNode instanceof Document) {
            currentNode.addChild (new Comment (content));
        } else {
            throw new DocumentBuilderException (
                    "Comments not allowed here.");
        }
    }
View Full Code Here

    public void addCData (String content) throws DocumentBuilderException {
        XMLNode currentNode = peek ();
        if (currentNode instanceof Document ||
                currentNode instanceof Element) {
           
            currentNode.addChild (new CData (content));
        } else {
            throw new DocumentBuilderException ("CData isn't allowed here.");
        }
    }
View Full Code Here

    }

    public void addDocType (String docType) throws DocumentBuilderException {
        XMLNode currentNode = peek ();
        if (currentNode instanceof Document) {
            currentNode.addChild (new DocType (docType));
        } else {
            throw new DocumentBuilderException (
                    "Document schema definitions aren't allowed here.");
        }
    }
View Full Code Here

    public void createProcessingInstructionStart (String piName)
            throws DocumentBuilderException {
        XMLNode currentNode = peek ();
        if (currentNode instanceof Document) {
            ProcessingInstruction pi = new ProcessingInstruction (piName);
            currentNode.addChild (pi);
            push (pi);
        } else {
            throw new DocumentBuilderException (
                    "Document schema definitions aren't allowed here.");
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.