+2005-07-30 Helge Hess <helge.hess@opengroupware.org>
+
+ * v.4.5.17
+
+ * DOMDocument.m: evaluate KVC keys starting with a slash '/' as query
+ path expressions
+
+ * DOMNode.m: changed to return 'nil' for unknown KVC keys instead of
+ raising an exception
+
2005-05-03 Helge Hess <helge.hess@opengroupware.org>
* DOMTreeWalker.m: fixed a MacOSX 10.4 warning (v4.5.16)
#include <DOM/DOMAttribute.h>
#include <DOM/DOMEntityReference.h>
#include "DOMSaxBuilder.h"
+#include "DOMNode+QueryPath.h"
#include "common.h"
//#define PROF_DEALLOC 1
return [self documentElement];
}
+/* Key/Value Coding */
+
+- (id)valueForKey:(NSString *)_key {
+ if ([_key hasPrefix:@"/"])
+ return [self lookupQueryPath:_key];
+
+ return [super valueForKey:_key];
+}
+
@end /* NGDOMDocument */
return nil;
}
+/* key/value coding */
+
+- (id)valueForUndefinedKey:(NSString *)_key {
+ /* default is to raise an exception, we just return nil */
+ return nil;
+}
+
/* description */
- (NSString *)description {
id<DOMDocument> document
= [builder buildFromSource:@"myfile.xml"];
+
+KVC
+===
+
+You can navigate the DOM tree with standard key/value coding. The NGDOMDocument
+will treat all KVC keys starting with a "/" as query path expressions.
+
+Samples:
+ document.documentElement => root DOMElement
+ document.documentElement.childNodes => NSArray containing the root children
+ document./uid => DOMElement or array! matching 'uid'
+ document./uid.textValue => text-value of 'uid' element
+
+
Some info on classes ...
========================
# version file
-SUBMINOR_VERSION:=16
+SUBMINOR_VERSION:=17