Package org.w3c.dom

Examples of org.w3c.dom.DOMException


    if (oContainers==null) {
      if (DebugFile.trace)
        DebugFile.writeln("ERROR: <containers> node not found.");

      throw new DOMException(DOMException.NOT_FOUND_ERR, "<containers> node not found");
    }

    // Load XML data stream only once for all containers
    if (DebugFile.trace)
      DebugFile.writeln("oXMLStream = new FileInputStream(" + sURI + ")");
View Full Code Here


    if (oContainers==null) {
      if (DebugFile.trace)
        DebugFile.writeln("ERROR: <containers> node not found.");

      throw new DOMException(DOMException.NOT_FOUND_ERR, "<containers> node not found");
    }

    // Cagar el stream de datos XML una sola vez
    if (DebugFile.trace)
      DebugFile.writeln("new FileInputStream(" + (sURI.startsWith("file://") ? sURI.substring(7) : sURI) + ")");
View Full Code Here

    String sAddresses = "\n  <company>" + sCompanyGUID + "</company>\n  <catalog>" + sCategoryGUID + "</catalog>\n  <addresses>\n" + oAddrs.toXML("    ", "address") + "\n  </addresses>";

    try { oXMLDoc.removeNode("pageset/company"); }
    catch (DOMException dome) {
      if (dome.code!=DOMException.NOT_FOUND_ERR) throw new DOMException(dome.code, dome.getMessage());
    }
    try { oXMLDoc.removeNode("pageset/catalog"); }
    catch (DOMException dome) {
      if (dome.code!=DOMException.NOT_FOUND_ERR) throw new DOMException(dome.code, dome.getMessage());
    }
    try { oXMLDoc.removeNode("pageset/addresses"); }
    catch (DOMException dome) {
      if (dome.code!=DOMException.NOT_FOUND_ERR) throw new DOMException(dome.code, dome.getMessage());
    }

    oXMLDoc.addNodeAndSave("pageset/pages", sAddresses);

    if (DebugFile.trace) {
View Full Code Here

  public Node setNamedItem(Node arg) throws DOMException {
    if (arg instanceof Attr) {
      return element.setAttributeNode((org.w3c.dom.Attr) arg);
    } else {
      throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
          "Node is not an Attr: " + arg);
    }
  }
View Full Code Here

  public Node removeNamedItem(String name) throws DOMException {
    org.w3c.dom.Attr attr = element.getAttributeNode(name);

    if (attr == null) {
      throw new DOMException(DOMException.NOT_FOUND_ERR,
          "No attribute named " + name);
    }

    return element.removeAttributeNode(attr);
  }
View Full Code Here

  public Node setNamedItemNS(Node arg) throws DOMException {
    if (arg instanceof Attr) {
      return element.setAttributeNodeNS((org.w3c.dom.Attr) arg);
    } else {
      throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
          "Node is not an Attr: " + arg);
    }
  }
View Full Code Here

                    String msg =
                        DOMMessageFormatter.formatMessage(
                            DOMMessageFormatter.DOM_DOMAIN,
                            "FEATURE_NOT_SUPPORTED",
                            new Object[] { name });
                    throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
                }
            }else if (
      name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)) {
        //namespace-declaration has effect only if namespaces is true
        features =
          (short) (state
            ? features | NSDECL
            : features & ~NSDECL);
        serializer.fNamespacePrefixes = state;             
            } else if (name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)
                    || name.equalsIgnoreCase(Constants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) {
                // false is not supported
                if (!state) {
                    String msg =
                        DOMMessageFormatter.formatMessage(
                            DOMMessageFormatter.DOM_DOMAIN,
                            "FEATURE_NOT_SUPPORTED",
                            new Object[] { name });
                    throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
                }
            } else {
                String msg =
                    DOMMessageFormatter.formatMessage(
                        DOMMessageFormatter.DOM_DOMAIN,
                        "FEATURE_NOT_FOUND",
                        new Object[] { name });
                throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
            }
        } else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
            if (value == null || value instanceof DOMErrorHandler) {
                fErrorHandler = (DOMErrorHandler)value;
            } else {
                String msg =
                    DOMMessageFormatter.formatMessage(
                        DOMMessageFormatter.DOM_DOMAIN,
                        "TYPE_MISMATCH_ERR",
                        new Object[] { name });
                throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg);
            }
        } else if (
            name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)
                || name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)
                || name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)
                || name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
                && value != null) {
            String msg =
                DOMMessageFormatter.formatMessage(
                    DOMMessageFormatter.DOM_DOMAIN,
                    "FEATURE_NOT_SUPPORTED",
                    new Object[] { name });
            throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
        } else {
            String msg =
                DOMMessageFormatter.formatMessage(
                    DOMMessageFormatter.DOM_DOMAIN,
                    "FEATURE_NOT_FOUND",
                    new Object[] { name });
            throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
        }
    }
View Full Code Here

            String msg =
                DOMMessageFormatter.formatMessage(
                    DOMMessageFormatter.DOM_DOMAIN,
                    "FEATURE_NOT_SUPPORTED",
                    new Object[] { name });
            throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
        } else {
            String msg =
                DOMMessageFormatter.formatMessage(
                    DOMMessageFormatter.DOM_DOMAIN,
                    "FEATURE_NOT_FOUND",
                    new Object[] { name });
            throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
        }
    }
View Full Code Here

            // into a string. This could have thrown for some other reason. -- mrglavas
            String msg = DOMMessageFormatter.formatMessage(
                DOMMessageFormatter.DOM_DOMAIN,
                "STRING_TOO_LONG",
                new Object[] { ioe.getMessage()});
            throw new DOMException(DOMException.DOMSTRING_SIZE_ERR,msg);
        }
       
        return destination.toString();
    }
View Full Code Here

//      This method applies only to types UNORDERED_NODE_ITERATOR_TYPE and ORDERED_NODE_ITERATOR_TYPE."},
      }

    if (getInvalidIteratorState()) {
          String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_DOC_MUTATED, null);                       
      throw new DOMException(DOMException.INVALID_STATE_ERR,fmsg)// Document mutated since result was returned. Iterator is invalid.
    }      

        Node node = m_iterator.nextNode();
        if(null == node)
          removeEventListener(); // JIRA 1673
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.