KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > saxon > om > VirtualDocumentCopy


1 package net.sf.saxon.om;
2
3 import net.sf.saxon.Configuration;
4
5 /**
6  * A virtual copy of a document node
7  *
8  */

9
10 public class VirtualDocumentCopy extends VirtualCopy implements DocumentInfo {
11
12     public VirtualDocumentCopy(DocumentInfo base) {
13         super(base);
14     }
15
16     /**
17      * Set the configuration, which defines the name pool used for all names in this document.
18      * This is always called after a new document has been created.
19      *
20      * @param config The configuration to be used
21      */

22
23     public void setConfiguration(Configuration config) {
24         //
25
}
26
27     /**
28      * Get the element with a given ID, if any
29      *
30      * @param id the required ID value
31      * @return the element with the given ID, or null if there is no such ID
32      * present (or if the parser has not notified attributes as being of
33      * type ID)
34      */

35
36     public NodeInfo selectID(String JavaDoc id) {
37         NodeInfo n = ((DocumentInfo)original).selectID(id);
38         if (n == null) {
39             return null;
40         }
41         VirtualCopy vc = VirtualCopy.makeVirtualCopy(n, original);
42         vc.documentNumber = documentNumber;
43         return vc;
44     }
45
46     /**
47      * Get the unparsed entity with a given name
48      *
49      * @param name the name of the entity
50      * @return if the entity exists, return an array of two Strings, the first
51      * holding the system ID of the entity, the second holding the public
52      * ID if there is one, or null if not. If the entity does not exist,
53      * return null.
54      */

55
56     public String JavaDoc[] getUnparsedEntity(String JavaDoc name) {
57         return ((DocumentInfo)original).getUnparsedEntity(name);
58     }
59 }
60
61 //
62
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
63
// you may not use this file except in compliance with the License. You may obtain a copy of the
64
// License at http://www.mozilla.org/MPL/
65
//
66
// Software distributed under the License is distributed on an "AS IS" basis,
67
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
68
// See the License for the specific language governing rights and limitations under the License.
69
//
70
// The Original Code is: all this file.
71
//
72
// The Initial Developer of the Original Code is Michael H. Kay.
73
//
74
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
75
//
76
// Contributor(s): none.
77
//
78

79
Popular Tags