]> err.no Git - sope/blob - sope-xml/DOM/DOMQueryPathExpression.h
added svn:keywords and svn:ignore where appropriate. removed CVS artifacts.
[sope] / sope-xml / DOM / DOMQueryPathExpression.h
1 /*
2   Copyright (C) 2000-2004 SKYRIX Software AG
3
4   This file is part of OpenGroupware.org.
5
6   OGo 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   OGo 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 OGo; 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 // $Id$
22
23 #ifndef __DOMQueryPathExpression_H__
24 #define __DOMQueryPathExpression_H__
25
26 #import <Foundation/NSObject.h>
27
28 @class NSString, NSArray;
29
30 @interface DOMQueryPathExpression : NSObject
31
32 /*
33   Syntax:
34     
35     First the QueryPath is separated into path components, then the path
36     components are evaluated:
37     
38     '-'   - placed in front of the path component, makes the search flat
39     '/'   - select DOM root node (usually the document-element)
40     '.'   - select current node
41     '..'  - select DOM parent node
42     '*'   - select all child elements (either deep or non-deep)
43     '!x'  - evaluate keypath 'x' on node
44     '?x'  - lookup processing instruction 'x' (either deep or non-deep)
45     '@x'  - lookup attribute 'x',
46               if x is '*', select all attributes (the map)
47               x may contain a ':' for namespace queries
48     
49     any other string: select a child-node with the string as the name.
50
51   Samples:
52
53     "./head/title" - lookup the 'title' node contained in the 'head' child node
54     "./@name"      - lookup the 'name' attribute of the current node
55     "./?blah"      - lookup the PI 'blah' starting with the current node
56     "./!values"    - call 'valueForKey:@"values"' on the current node
57     "/-title"      - flat search for 'title' element
58 */
59
60 + (id)queryPathWithString:(NSString *)_string;
61 + (id)queryPathWithComponents:(NSArray *)_string;
62 + (NSArray *)queryPathComponentsOfString:(NSString *)_path;
63
64 - (id)evaluateWithNode:(id)_node; // DEPRECATED !!!
65 - (id)evaluateWithNodeList:(id)_nodeList;
66
67 @end
68
69 #endif /* __DOMQueryPathExpression_H__ */