]> err.no Git - sope/blob - sope-xml/DOM/DOMDocument+factory.m
fixed some comments
[sope] / sope-xml / DOM / DOMDocument+factory.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 <DOM/DOMDocument.h>
23 #include <DOM/DOMProcessingInstruction.h>
24 #include <DOM/DOMElement.h>
25 #include <DOM/DOMAttribute.h>
26 #include <DOM/DOMEntityReference.h>
27 #include <DOM/DOMImplementation.h>
28 #include "common.h"
29
30 #include <DOM/DOMTreeWalker.h>
31
32 @implementation NGDOMDocument(DocumentTraversal)
33
34 - (Class)domTreeWalkerClass {
35   return NSClassFromString(@"DOMTreeWalker");
36 }
37
38 - (id)createNodeIterator:(id)_node
39   whatToShow:(unsigned long)_whatToShow
40   filter:(id)_filter
41 {
42   [self doesNotRecognizeSelector:_cmd];
43   return nil;
44 }
45
46 - (id)createTreeWalker:(id)_rootNode
47   whatToShow:(unsigned long)_whatToShow
48   filter:(id)_filter
49   expandEntityReferences:(BOOL)_expandEntityReferences
50 {
51   id walker;
52
53   // should throw DOMException with NOT_SUPPORTED_ERR
54   NSAssert(_rootNode, @"invalid root node !");
55
56   walker = [[[self domTreeWalkerClass] alloc]
57                    initWithRootNode:_rootNode
58                    whatToShow:_whatToShow
59                    filter:_filter
60                    expandEntityReferences:_expandEntityReferences];
61   return [walker autorelease];
62 }
63
64 @end /* NGDOMDocument(DocumentTraversal) */