]> err.no Git - sope/blob - sope-xml/DOM/DOMImplementation.m
lF fixes
[sope] / sope-xml / DOM / DOMImplementation.m
1 /*
2   Copyright (C) 2000-2005 SKYRIX Software AG
3
4   This file is part of SOPE.
5
6   SOPE is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with SOPE; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21
22 #include "DOMImplementation.h"
23 #include "DOMDocument.h"
24 #include "DOMDocumentFragment.h"
25 #include "common.h"
26
27 @implementation NGDOMImplementation
28
29 - (id)init {
30   self->elementClass  = NSClassFromString(@"NGDOMElement");
31   self->textNodeClass = NSClassFromString(@"NGDOMText");
32   self->attrClass     = NSClassFromString(@"NGDOMAttribute");
33   return self;
34 }
35
36 - (Class)domDocumentClass {
37   return [NGDOMDocument class];
38 }
39 - (Class)domDocumentTypeClass {
40   return NSClassFromString(@"NGDOMDocumentType");
41 }
42
43 - (Class)domElementClass {
44   return self->elementClass;
45 }
46 - (Class)domElementNSClass {
47   return self->elementClass;
48 }
49 - (Class)domDocumentFragmentClass {
50   return NSClassFromString(@"NGDOMDocumentFragment");
51 }
52 - (Class)domTextNodeClass {
53   return self->textNodeClass;
54 }
55 - (Class)domCommentClass {
56   return NSClassFromString(@"NGDOMComment");
57 }
58 - (Class)domCDATAClass {
59   return NSClassFromString(@"NGDOMCDATA");
60 }
61 - (Class)domProcessingInstructionClass {
62   return NSClassFromString(@"NGDOMProcessingInstruction");
63 }
64 - (Class)domAttributeClass {
65   return self->attrClass;
66 }
67 - (Class)domAttributeNSClass {
68   return self->attrClass;
69 }
70 - (Class)domEntityReferenceClass {
71   return NSClassFromString(@"NGDOMEntityReference");
72 }
73
74 - (id)createDocumentWithName:(NSString *)_qname
75   namespaceURI:(NSString *)_uri
76   documentType:(id)_doctype
77 {
78   id doc;
79   
80   doc = [[[self domDocumentClass] alloc]
81           initWithName:_qname namespaceURI:_uri documentType:_doctype
82           dom:self];
83   
84   return [doc autorelease];
85 }
86
87 - (id)createDocumentType:(NSString *)_qname
88   publicId:(NSString *)_pubId
89   systemId:(NSString *)_sysId
90 {
91   id doc;
92   
93   doc = [[[self domDocumentTypeClass] alloc]
94           initWithName:_qname publicId:_pubId systemId:_sysId dom:self];
95   
96   return [doc autorelease];
97 }
98
99 @end /* NGDOMImplementation */