Project

Profile

Help

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

he / latest9.3 / hej / net / sf / saxon / dom / package.html @ 377d5515

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>The native Saxon tree structures (the linked tree and tiny tree) do not
14
implement DOM interfaces directly. However, Saxon supports the DOM at two levels:</p>
15

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

    
30
<p>The classes {@link net.sf.saxon.dom.NodeWrapper} and {@link net.sf.saxon.dom.DocumentWrapper} implement the Saxon interfaces
31
{@link net.sf.saxon.om.NodeInfo} and {@link net.sf.saxon.om.DocumentInfo} on top of an underlying DOM
32
    <code>Node</code> or <code>Document</code> object respectively. This enables XPath expressions to be executed directly against
33
the DOM.</p>
34

    
35
<p>The classes {@link net.sf.saxon.dom.NodeOverNodeInfo},
36
    {@link net.sf.saxon.dom.DocumentOverNodeInfo}, and the like do the converse:
37
they provide a DOM wrapper over a native Saxon node.</p>
38

    
39
<p><b>Note that using the DOM with Saxon is considerably less efficient than using
40
Saxon's native tree implementations, the TinyTree and the LinkedTree.
41
The DOM should be used only where there is some good reason, e.g. where other parts
42
of the application have to use DOM interfaces.</b></p>
43

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

    
48
<hr>
49

    
50
<p align="center"><i>Michael H. Kay<br/>
51
Saxonica Limited<br/>
52
July 2010</i></p>
53
</body>
54
</html>
(22-22/22)