Example usage for org.w3c.dom.ranges Range cloneContents

List of usage examples for org.w3c.dom.ranges Range cloneContents

Introduction

In this page you can find the example usage for org.w3c.dom.ranges Range cloneContents.

Prototype

public DocumentFragment cloneContents() throws DOMException;

Source Link

Document

Duplicates the contents of a Range

Usage

From source file:org.eclipse.ecr.runtime.model.impl.ConfigurationDescriptorImpl.java

public DocumentFragment getFragment() {
    element.normalize();//from w w  w. ja  v  a2  s .  c o m
    Node node = element.getFirstChild();
    if (node == null) {
        return null;
    }
    Range range = ((DocumentRange) element.getOwnerDocument()).createRange();
    range.setStartBefore(node);
    range.setEndAfter(element.getLastChild());
    return range.cloneContents();
}