01: /* DOMImplementation.java
02:
03: {{IS_NOTE
04:
05: Purpose:
06: Description:
07: History:
08: 2001/09/28 20:21:46, Create, Tom M. Yeh.
09: }}IS_NOTE
10:
11: Copyright (C) 2001 Potix Corporation. All Rights Reserved.
12:
13: {{IS_RIGHT
14: This program is distributed under GPL Version 2.0 in the hope that
15: it will be useful, but WITHOUT ANY WARRANTY.
16: }}IS_RIGHT
17: */
18: package org.zkoss.idom.impl;
19:
20: import org.zkoss.idom.*;
21:
22: /**
23: * The iDOM's implementation of DOMImplementation.
24: *
25: * @author tomyeh
26: */
27: public class DOMImplementation implements org.w3c.dom.DOMImplementation {
28: /** DOM implementation singleton.
29: */
30: public static final DOMImplementation THE = new DOMImplementation();
31:
32: protected DOMImplementation() {
33: }
34:
35: //-- DOMImplementation --//
36: public boolean hasFeature(String feature, String version) {
37: return "XML".equalsIgnoreCase(feature)
38: && (version == null || "2.0".equals(version) || "1.0"
39: .equals(version));
40: }
41:
42: public org.w3c.dom.DocumentType createDocumentType(String tname,
43: String publicId, String systemId) {
44: // Note that DOM2 specifies that ownerDocument = null
45: return new DocType(tname, publicId, systemId);
46: }
47:
48: public org.w3c.dom.Document createDocument(String nsURI,
49: String tname, org.w3c.dom.DocumentType docType) {
50: return new Document(new Element(nsURI, tname),
51: (DocType) docType);
52: }
53:
54: public Object getFeature(String feature, String version) {
55: return null; //Level 3 not yet
56: }
57: }
|