Package org.apache.xerces.dom

Examples of org.apache.xerces.dom.DOMExceptionImpl


    }
   
    void checkIndex(Node refNode, int offset) throws DOMException
    {
        if (offset < 0) {
        throw new DOMExceptionImpl(
          DOMException.INDEX_SIZE_ERR,
      "DOM004 Index out of bounds");
      }

        int type = refNode.getNodeType();
       
        if((type == Node.TEXT_NODE
        || type == Node.CDATA_SECTION_NODE
        || type == Node.COMMENT_NODE
        || type == Node.PROCESSING_INSTRUCTION_NODE)
        && offset > refNode.getNodeValue().length()){
        throw new DOMExceptionImpl(
          DOMException.INDEX_SIZE_ERR,
      "DOM004 Index out of bounds");
        }
       
        Node child = refNode.getFirstChild();
        int i = 1;
        for (; child != null; i++) {
            child = child.getNextSibling();
        }
        if (i > offset) {
        throw new DOMExceptionImpl(
          DOMException.INDEX_SIZE_ERR,
      "DOM004 Index out of bounds");
        }
           
    }
View Full Code Here

TOP

Related Classes of org.apache.xerces.dom.DOMExceptionImpl

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.