4DOM Ranges
4DOM
Ranges
DOM
Documentation on 4DOM implementation of the Ranges Level II and the deviations from the specification.
The implementation of Ranges in 4DOM supports all of the interfaces defined at http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ It does not support section 2.12, "Range modification under document mutation". The implementation of Ranges is written such that any Python compliant DOM implementation should be able to take advantage of them. The additional methods that an implementation needs to support are defined below.
See the 4DOM test_suite directory for the file test_ranges.py to see examples of using ranges
Range Creation
To create a range from a document, simple call the createRange method. This is the only method that a DOM implementatio needs to add to allow range support. An implementation of this method will create a new instance of the xml.dom.Range.Range class passing the document into the constructor.
For a complete listing of the interfaces on the Range instances, see the specification at http://www.w3.org/TR/DOM-Level-2-Traversal-Range/