2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
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
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.
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
22 #include <NGObjWeb/WOxElemBuilder.h>
24 // TODO: multiselection should set the "multiple" binding?
27 This builder builds control flow elements, eg conditionals and
31 <var:string .../> maps to WOString
32 <var:component-content/> maps to WOComponentContent
33 <var:entity .../> maps to WOEntity
34 <var:nbsp .../> maps to WOEntity
35 <var:popup ../> maps to WOPopUpButton
36 <var:singleselection ../> maps to WOBrowser
37 <var:multiselection .../> maps to WOBrowser
38 <var:radio-button-matrix .../> maps to WORadioButtonMatrix
39 <var:checkbox-list .../> maps to WOCheckBoxList
42 @interface WOxMiscElemBuilder : WOxTagClassElemBuilder
48 #include <SaxObjC/XMLNamespaces.h>
51 @implementation WOxMiscElemBuilder
53 - (Class)classForElement:(id<DOMElement>)_element {
58 if (_element == nil) return nil;
60 nsuri = [_element namespaceURI];
61 if (![nsuri isEqualToString:XMLNS_OD_BIND])
64 tag = [_element tagName];
70 switch ([tag characterAtIndex:0]) {
72 if ([tag isEqualToString:@"component-content"])
73 return NSClassFromString(@"WOComponentContent");
74 if ([tag isEqualToString:@"checkbox-list"])
75 return NSClassFromString(@"WOCheckBoxList");
79 if ([tag isEqualToString:@"entity"])
80 return NSClassFromString(@"WOEntity");
84 if ([tag isEqualToString:@"multiselection"])
85 return NSClassFromString(@"WOBrowser");
89 if ([tag isEqualToString:@"nbsp"]) {
90 [self warnWithFormat:@"%s: found <var:nbsp/>, "
91 @"use <var:entity name='nbsp'/> !",
93 return NSClassFromString(@"WOEntity");
98 if ([tag isEqualToString:@"popup"])
99 return NSClassFromString(@"WOPopUpButton");
103 if ([tag isEqualToString:@"radio-button-matrix"])
104 return NSClassFromString(@"WORadioButtonMatrix");
108 if ([tag isEqualToString:@"string"])
109 return NSClassFromString(@"WOString");
110 if ([tag isEqualToString:@"singleselection"])
111 return NSClassFromString(@"WOBrowser");
117 @end /* SxMiscElemBuilder */