July 2000
Intermediate to advanced
400 pages
7h 33m
English
The DocumentFragment node is a very lightweight version of the Element object meant for DOM cut and paste operations. A DocumentFragment node is a generic container for other nodes that can be inserted as a group somewhere else in the hierarchy. The DocumentFragment node must implement the DocumentFragment interface, which is a marker interface that extends Node but adds no new methods. The key to the DocumentFragment node type is how other methods treat it when it is passed as a parameter. Consider the following Java code:
import org.w3c.dom.*; void dupEm(Document doc) { DocumentFragment frag = doc.createDocumentFragment(); NodeList authors = doc.getElementsByTagNameNS("urn:bru", "author"); frag.appendChild(authors.item(0)); ...Read now
Unlock full access