Project

Profile

Help

How to connect?
Download (2.62 KB) Statistics
| Branch: | Tag: | Revision:

he / latest9.2 / hej / net / sf / saxon / dom / package.html @ d5c06c04

1
<html>
2

    
3
<head>
4
<title>Package overview for net.sf.saxon.dom</title>
5
</head>
6

    
7
<body>
8

    
9
<p>This package provides glue classes that enable Saxon to process a source
10
document supplied as a DOM tree in the form of a DOMSource object; it also provides
11
classes that present a DOM view of Saxon's native tree structures.</p>
12

    
13
<p>Because of incompatibilities between the DOM interfaces in JDK 1.4 and JDK 1.5,
14
the native Saxon tree structures (the standard tree and tiny tree) no longer
15
implements DOM interfaces directly. In addition, to reduce installation problems
16
for users who dont require DOM interfaces, this package is delivered in a JAR file
17
of its own, <code>saxon8-dom.jar</code>, and not with the main <code>saxon8.jar</code>
18
JAR file. However, Saxon continues to support the DOM at two levels:</p>
19

    
20
<ul>
21
<li><p>The input to a transformation or query may be supplied in the form of
22
a <code>DOMSource</code> (which contains a DOM document). Saxon performs the
23
query or transformation on the DOM <i>in situ</i>, by wrapping the DOM nodes in
24
a layer that make them appear to be Saxon nodes.</p></li>
25
<li><p>It is possible for a transformation or query to call extension functions
26
that use DOM interfaces to access a Saxon tree. If the Saxon tree is in fact a wrapper
27
around the DOM, then extension functions will be presented with the underlying
28
DOM nodes. In other cases, Saxon adds a wrapper to the native Saxon nodes to make
29
them implement the DOM interfaces.</p>
30
<p>Note, however, that Saxon's tree structures are immutable. Updating interfaces
31
in the DOM API are therefore not supported.</p></li></ul>
32

    
33
<p>The classes NodeWrapper and DocumentWrapper implement the Saxon interfaces
34
NodeInfo and DocumentInfo on top of an underlying DOM Node or Document object
35
respectively. This enables XPath expressions to be executed directly against
36
the DOM.</p>
37

    
38
<p>The classes NodeOverNodeInfo, DocumentOverNodeInfo, and the like do the converse:
39
they provide a DOM wrapper over a native Saxon node.</p>
40

    
41
<p>Note that using the DOM with Saxon is considerably less efficient than using
42
Saxon's native tree implementations, the Tiny Tree and the (so-called) Standard Tree.
43
The DOM should be used only where there is some good reason, e.g. where other parts
44
of the application have to use DOM interfaces.</p>
45

    
46
<p>Saxon doesn't stop you modifying the contents of the DOM in the course of a
47
transformation (for example, from an extension function, or in a different thread)
48
but the consequences of doing so are unpredictable.</p>
49

    
50
<hr>
51

    
52
<p align="center"><i>Michael H. Kay<br/>
53
Saxonica Limited<br/>
54
9 February 2005</i></p>
55
</body>
56
</html>
(22-22/22)