Project

Profile

Help

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

he / latest10 / hej / net / sf / saxon / dom / package.html @ 02f8308b

1
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
2
<!-- Copyright (c) 2014 Saxonica Limited. -->
3
<!-- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. -->
4
<!-- If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
5
<!-- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. -->
6
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
7

    
8
<html>
9

    
10
<head>
11
    <title>Package overview for net.sf.saxon.dom</title>
12
</head>
13

    
14
<body>
15

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

    
20
<p>The native Saxon tree structures (the linked tree and tiny tree) do not
21
    implement DOM interfaces directly. However, Saxon supports the DOM at two levels:</p>
22

    
23
<ul>
24
    <li><p>The input to a transformation or query may be supplied in the form of
25
        a <code>DOMSource</code> (which contains a DOM document). Saxon is capable of either performing the
26
        query or transformation on the DOM <i>in situ</i>, by wrapping the DOM nodes in
27
        a layer that make them appear to be Saxon nodes, or of converting the DOM to Saxon's native tree
28
        implementation. </p></li>
29
    <li><p>It is possible for a transformation or query to call extension functions
30
        that use DOM interfaces to access a Saxon tree. If the Saxon tree is in fact a wrapper
31
        around the DOM, then extension functions will be presented with the underlying
32
        DOM nodes. In other cases, Saxon adds a wrapper to the native Saxon nodes to make
33
        them implement the DOM interfaces.</p>
34

    
35
        <p>Note that Saxon's tree structures are immutable. Updating interfaces
36
            in the DOM API are therefore not supported.</p></li>
37
</ul>
38

    
39
<p>The classes {@link net.sf.saxon.dom.NodeWrapper} and {@link net.sf.saxon.dom.DocumentWrapper} implement the Saxon
40
    interface
41
    {@link net.sf.saxon.om.NodeInfo} on top of an underlying DOM
42
    <code>Node</code> or <code>Document</code> object. This enables XPath expressions to be executed
43
    directly against
44
    the DOM.</p>
45

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

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

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

    
59
</body>
60
</html>
(21-21/21)