1 package net.sf.saxon.jdom; 2 import net.sf.saxon.Configuration; 3 import net.sf.saxon.om.DocumentInfo; 4 import net.sf.saxon.om.NamePool; 5 import net.sf.saxon.om.NodeInfo; 6 import net.sf.saxon.type.Type; 7 import org.jdom.Document; 8 9 16 17 public class DocumentWrapper extends NodeWrapper implements DocumentInfo { 18 19 protected Configuration config; 20 protected String baseURI; 21 protected int documentNumber; 22 23 28 29 public DocumentWrapper(Document doc, String baseURI, Configuration config) { 30 super(doc, null, 0); 31 node = doc; 32 nodeKind = Type.DOCUMENT; 33 this.baseURI = baseURI; 34 docWrapper = this; 35 setConfiguration(config); 36 } 37 38 44 45 public NodeWrapper wrap(Object node) { 46 if (node==this.node) { 47 return this; 48 } 49 return makeWrapper(node, this); 50 } 51 52 53 54 57 58 public void setConfiguration(Configuration config) { 59 this.config = config; 60 documentNumber = config.getDocumentNumberAllocator().allocateDocumentNumber(); 61 } 62 63 67 68 public Configuration getConfiguration() { 69 return config; 70 } 71 72 73 76 77 public NamePool getNamePool() { 78 return config.getNamePool(); 79 } 80 81 84 85 public int getDocumentNumber() { 86 return documentNumber; 87 } 88 89 94 95 public NodeInfo selectID(String id) { 96 return null; 97 } 98 99 104 105 public String [] getUnparsedEntity(String name) { 106 return null; 107 } 108 109 110 } 111 112 | Popular Tags |