01: package net.sf.saxon.om;
02:
03: /**
04: * This interface represents a document node as defined in the XPath 2.0 data model.
05: * It extends NodeInfo, which is used to represent any node. Every document node must
06: * be an instance of DocumentInfo.
07: * <p>
08: * The interface supports two methods in addition to those for NodeInfo: one to find
09: * elements given their ID value, and one to locate unparsed entities. In addition,
10: * document nodes have an important property that is not true of nodes in general:
11: * two distinct Java DocumentInfo objects never represent the same document node.
12: * So the Java "==" operator returns the same result as the {@link NodeInfo#isSameNodeInfo}
13: * method.
14: * <p>
15: * This interface is part of the Saxon public API, and as such (from Saxon8.4 onwards)
16: * those methods that form part of the stable public API are labelled with a JavaDoc "since" tag
17: * to indicate when they were added to the product.
18: *
19: * @author Michael H. Kay
20: * @since 8.4
21: */
22:
23: public interface DocumentInfo extends NodeInfo {
24:
25: /**
26: * Get the element with a given ID, if any
27: *
28: * @param id the required ID value
29: * @return the element with the given ID, or null if there is no such ID
30: * present (or if the parser has not notified attributes as being of
31: * type ID)
32: * @since 8.4
33: */
34:
35: public NodeInfo selectID(String id);
36:
37: /**
38: * Get the unparsed entity with a given name
39: *
40: * @param name the name of the entity
41: * @return if the entity exists, return an array of two Strings, the first
42: * holding the system ID of the entity, the second holding the public
43: * ID if there is one, or null if not. If the entity does not exist,
44: * the method returns null. Applications should be written on the
45: * assumption that this array may be extended in the future to provide
46: * additional information.
47: * @since 8.4
48: */
49:
50: public String[] getUnparsedEntity(String name);
51:
52: }
53:
54: //
55: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
56: // you may not use this file except in compliance with the License. You may obtain a copy of the
57: // License at http://www.mozilla.org/MPL/
58: //
59: // Software distributed under the License is distributed on an "AS IS" basis,
60: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
61: // See the License for the specific language governing rights and limitations under the License.
62: //
63: // The Original Code is: all this file.
64: //
65: // The Initial Developer of the Original Code is Michael H. Kay.
66: //
67: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
68: //
69: // Contributor(s): none.
70: //
|