01: package net.sf.saxon.om;
02:
03: import net.sf.saxon.Configuration;
04:
05: /**
06: * A virtual copy of a document node
07: *
08: */
09:
10: public class VirtualDocumentCopy extends VirtualCopy implements
11: DocumentInfo {
12:
13: public VirtualDocumentCopy(DocumentInfo base) {
14: super (base);
15: }
16:
17: /**
18: * Set the configuration, which defines the name pool used for all names in this document.
19: * This is always called after a new document has been created.
20: *
21: * @param config The configuration to be used
22: */
23:
24: public void setConfiguration(Configuration config) {
25: //
26: }
27:
28: /**
29: * Get the element with a given ID, if any
30: *
31: * @param id the required ID value
32: * @return the element with the given ID, or null if there is no such ID
33: * present (or if the parser has not notified attributes as being of
34: * type ID)
35: */
36:
37: public NodeInfo selectID(String id) {
38: NodeInfo n = ((DocumentInfo) original).selectID(id);
39: if (n == null) {
40: return null;
41: }
42: VirtualCopy vc = VirtualCopy.makeVirtualCopy(n, original);
43: vc.documentNumber = documentNumber;
44: return vc;
45: }
46:
47: /**
48: * Get the unparsed entity with a given name
49: *
50: * @param name the name of the entity
51: * @return if the entity exists, return an array of two Strings, the first
52: * holding the system ID of the entity, the second holding the public
53: * ID if there is one, or null if not. If the entity does not exist,
54: * return null.
55: */
56:
57: public String[] getUnparsedEntity(String name) {
58: return ((DocumentInfo) original).getUnparsedEntity(name);
59: }
60: }
61:
62: //
63: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
64: // you may not use this file except in compliance with the License. You may obtain a copy of the
65: // License at http://www.mozilla.org/MPL/
66: //
67: // Software distributed under the License is distributed on an "AS IS" basis,
68: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
69: // See the License for the specific language governing rights and limitations under the License.
70: //
71: // The Original Code is: all this file.
72: //
73: // The Initial Developer of the Original Code is Michael H. Kay.
74: //
75: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
76: //
77: // Contributor(s): none.
78: //
|