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