Package org.w3c.dom

Examples of org.w3c.dom.DOMException


        if (m_doc != null) {
       
            // Check that the context node is owned by the same document
            if ((contextNode != m_doc) && (!contextNode.getOwnerDocument().equals(m_doc))) {
                String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_DOCUMENT, null);      
                throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, fmsg);
            }
           
            // Check that the context node is an acceptable node type
            short nodeType = contextNode.getNodeType();
            if ((nodeType != Document.DOCUMENT_NODE) &&
                (nodeType != Document.ELEMENT_NODE) &&
                (nodeType != Document.ATTRIBUTE_NODE) &&
                (nodeType != Document.TEXT_NODE) &&
                (nodeType != Document.CDATA_SECTION_NODE) &&
                (nodeType != Document.COMMENT_NODE) &&
                (nodeType != Document.PROCESSING_INSTRUCTION_NODE) &&
                (nodeType != XPathNamespace.XPATH_NAMESPACE_NODE)) {
                    String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_NODETYPE, null);      
                    throw new DOMException(DOMException.NOT_SUPPORTED_ERR, fmsg);
            }
        }
           
        //    
        // If the type is not a supported type, throw an exception and be
View Full Code Here


    /**
     * @see org.w3c.dom.Node#cloneNode(boolean)
     */
    public Node cloneNode(boolean arg0) {
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR,null);
    }
View Full Code Here

     
    } catch (TransformerException e) {
      // Need to pass back exception code DOMException.NAMESPACE_ERR also.
      // Error found in DOM Level 3 XPath Test Suite.
      if(e instanceof XPathStylesheetDOM3Exception)
        throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation());
      else
        throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation());
       
    }
  }
View Full Code Here

     *
     * @see com.sun.org.apache.xml.internal.utils.PrefixResolver#getNamespaceForPrefix(String, Node)
     */
    public String getNamespaceForPrefix(String prefix, Node context) {
            String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_RESOLVER, null);      
            throw new DOMException(DOMException.NAMESPACE_ERR, fmsg);   // Unable to resolve prefix with null prefix resolver.        
    }
View Full Code Here

         }
         Node xpathnode = xpathElement.getChildNodes().item(0);
         String str=CachedXPathFuncHereAPI.getStrFromNode(xpathnode);
         input.setNeedsToBeExpanded(needsCircunvent(str));
         if (xpathnode == null) {
           throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
                                  "Text must be in ds:Xpath");
        }


         input.addNodeFilter(new XPathNodeFilter( xpathElement, xpathnode, str));
View Full Code Here

            // At least one Reference must be present. Bad.
            Object exArgs[] = { Constants._TAG_REFERENCE,
                                Constants._TAG_MANIFEST };

            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
                                   I18n.translate("xml.WrongContent", exArgs));
         }
      }

      // create Vector
View Full Code Here

        list.add(index, newChild);
      }

      return newChild;
    } else {
      throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
          "Children not allowed for this node: " + node);
    }
  }
View Full Code Here

      Branch branch = (Branch) node;
      List list = branch.content();
      int index = list.indexOf(oldChild);

      if (index < 0) {
        throw new DOMException(DOMException.NOT_FOUND_ERR,
            "Tried to replace a non existing child " + "for node: "
                + node);
      }

      list.set(index, newChild);

      return oldChild;
    } else {
      throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
          "Children not allowed for this node: " + node);
    }
  }
View Full Code Here

      branch.remove((Node) oldChild);

      return oldChild;
    }

    throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
        "Children not allowed for this node: " + node);
  }
View Full Code Here

      branch.add((Node) newChild);

      return newChild;
    }

    throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
        "Children not allowed for this node: " + node);
  }
View Full Code Here

TOP

Related Classes of org.w3c.dom.DOMException

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.