6.12 Notes on the org.w3c.dom Package

The following table gives cautionary notes on the org.w3c.dom package.

Table 6-23 Notes on the org.w3c.dom package

No.Notes
1Table 6-24 lists the parameters that can be set for the DOMConfiguration object. Parameters that can be set do not match the return values from the getParameterNames and canSetParameter methods. Also, if you specify a value that cannot be set, an exception may not occur. If you specify a value that cannot be set, the operation is not guaranteed.
2The parameter name for the DOMConfiguration object is not case-sensitive.
3For the DOM Level 3, new methods are added to the interface for the existing DOM Level 2. For example, the isId method is added to the Attr interface. Usually, no application program implements these interfaces. If the application implements the interfaces, the method implementation added for the DOM Level 3 needs to be added to the application.
4If you define the default value for an attribute in XMLSchema and delete the Attr node that corresponds to that attribute, the attribute node for which the getSpecified method returns false will not be generated.
5The normalizeDocument method of the Document object is not supported.
6The adoptNode method of the Document object is not supported. Instead, use a combination of the importNode method of the Document object and the removeChild method of the Node object.
7The getInputEncoding method of the Document object and the getInputEncoding method of the Entity object are not supported.
8When all of the following conditions are met, a DOMException does not occur by executing the renameNode(Node n, String namespaceURI, String qualifiedName) method of the Document object:
  • The n argument is an Attr object that does not support namespace.
  • The namespaceURI argument is null.
  • The qualifiedName argument is an invalid qualified name.
If you specify the Element or Attr object for the n argument and specify null for the qualifiedName argument, a NullPointerException occurs rather than a DOMException.
9The getBaseURI method of the Attr, Text, EntityReference, CDATASection, DocumentType, and DocumentFragment objects cannot obtain a URI.
10Apply the replaceWholeText(String) method of the Text object to the DOM tree without a EntityReference node.
11A return value from the getByteOffset of the DOMLocator object is always -1.
12An object of the return value when you apply the getRelatedData method to the DOMError argument of the handleError method of the DOMErrorHandler object is not always a Node object. The return value can be the String object indicating an error message.
13For a Document object acquired by parsing, the DOMException exception might not occur even when the insertBefore method or the appendChild method is used to add an inappropriate node.
14When all the following conditions are satisfied, the return value of invoking the getSchemaTypeInfo method for an element node is invalid:
  1. Use an XML schema document to define a derived type element using union.
  2. Use the schema document described in condition 1 above to implement verification check parsing.
  3. Acquire the element node corresponding to condition 1 above from the DOM that is created in condition 2, and invoke the getSchemaTypeInfo method.

Table 6-24 Parameters that can be set for DOMConfiguration objects

Parameter nameValid values
canonical-form false
cdata-sectionstrue, false
check-character-normalizationfalse
commentstrue, false
datatype-normalizationfalse
element-content-whitespacetrue
entitiestrue, false
error-handlerDOMErrorHandler object
infosettrue, false
namespacestrue
namespace-declarationstrue, false
normalize-charactersfalse
schema-locationCannot be set.
schema-typeCannot be set.
split-cdata-sectionstrue, false
validatefalse
validate-if-schemafalse
well-formedtrue
resource-resolverLSResourceResolver object