xpath/XMLv2__XPathProcessor.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 05 Feb 2016 02:32:40 +0000
changeset 303 04365cd0296b
parent 296 ea3dbc023c80
permissions -rw-r--r--
Added .hgignore
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Package: 'stx:goodies/xmlsuite/xpath' }"
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
"{ NameSpace: XMLv2 }"
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
Object subclass:#XPathProcessor
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
	instanceVariableNames:'expressionParser documentAdaptor'
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	classVariableNames:''
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
	poolDictionaries:''
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
	category:'XML Suite-XPath'
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
!
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
!XPathProcessor class methodsFor:'instance creation'!
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
new
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
    ^ self basicNew initialize.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
! !
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
!XPathProcessor methodsFor:'initialization'!
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
documentAdaptor:anXPathDocumentAdaptor
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
    <resource: #obsolete>
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
    self obsoleteMethodWarning.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
    
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
    documentAdaptor := anXPathDocumentAdaptor.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
    "Created: / 13-10-2006 / 17:23:33 / janfrog"
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
    "Modified: / 25-10-2006 / 17:14:36 / janfrog"
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
!
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
initialize
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
    super initialize.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
    expressionParser := XPathExpressionParser new.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
!
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
setDocumentAdaptor:anXPathDocumentAdaptor 
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
    documentAdaptor := anXPathDocumentAdaptor.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
    "Created: / 25-10-2006 / 17:14:07 / janfrog"
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
!
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
setDocumentProvider:aDocumentProvider
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
    "Nothing to do here"
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
    "Created: / 25-10-2006 / 17:15:40 / janfrog"
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
! !
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
!XPathProcessor methodsFor:'private'!
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
evaluateTree:anExpressionTreeRootNode inContext:aContext 
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
    |location_path nodeSet context|
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
    XPathExprTreeNode loadRules.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
    location_path := anExpressionTreeRootNode 
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
                evaluateWithDerivedValue:(XPathExpression new).
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
    context := aContext.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
    location_path absolute ifTrue:[
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
        context := documentAdaptor xpathRootContext
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
    ].
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
    nodeSet := aContext newNodeSetWith:(context node).
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
    location_path steps do:[:step | 
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
        |newNodeSet|
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
        newNodeSet := aContext newNodeSet.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
        nodeSet do:[:node | 
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
            "get elements by axis"
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
            newNodeSet addAll:(step axis 
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
                        createNodeSetFromContext:(documentAdaptor xpathContextOf:node)).
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
             "filter the set using node test"
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
            newNodeSet := step nodeTest filterNodeSet:newNodeSet.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
             "filter the set using predicates"
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
        ].
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
        nodeSet := newNodeSet.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
    ].
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
    nodeSet documentAdaptor:documentAdaptor.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
    ^ nodeSet.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
    "Created: / 25-10-2006 / 17:27:44 / janfrog"
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
    "Modified: / 15-11-2007 / 22:10:42 / janfrog"
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
!
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    84
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
sortByDocumentOrder:aNodeSet 
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
    ^aNodeSet 
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    87
        ifNil:[#()]
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
        ifNotNil:[
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
            aNodeSet 
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
                asSortedCollection:documentAdaptor xpathNodePositionComparator]
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    91
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
                "[:right :left | 
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
                |result leftPos rightPos pos|
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    94
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95
                leftPos := documentAdaptor xpathPositionVectorOf:left.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    96
                rightPos := documentAdaptor xpathPositionVectorOf:right.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
                pos := 1.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
                [
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
                    ((pos <= leftPos elementPosition size) 
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   101
                        and:[ pos <= rightPos elementPosition size ]) and:[ result isNil ]
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   102
                ] whileTrue:[
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   103
                    ((leftPos elementPosition at:pos) > (rightPos elementPosition at:pos)) ifTrue:[
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   104
                        result := true.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   105
                    ].
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   106
                    ((leftPos elementPosition at:pos) < (rightPos elementPosition at:pos)) ifTrue:[
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   107
                        result := false.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   108
                    ].
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   109
                    pos := pos + 1.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   110
                ].
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   111
                (leftPos elementPosition size = (rightPos elementPosition size)) ifTrue:[
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   112
                    pos := 1.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   113
                    [
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   114
                        ((pos <= leftPos attributePosition size) 
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   115
                            and:[ pos <= rightPos attributePosition size ]) and:[ result isNil ]
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   116
                    ] whileTrue:[
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   117
                        ((leftPos attributePosition at:pos) > (rightPos attributePosition at:pos)) ifTrue:[
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   118
                            result := true.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   119
                        ].
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   120
                        ((leftPos attributePosition at:pos) < (rightPos attributePosition at:pos)) ifTrue:[
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   121
                            result := false.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   122
                        ].
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   123
                        pos := pos + 1.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   124
                    ].
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   125
                ].
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   126
                result isNil ifTrue:[
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   127
                    result := true
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   128
                ].
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   129
                result.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   130
            ]
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   131
    ]."
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   132
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   133
    "Modified: / 13-10-2006 / 20:06:46 / janfrog"
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   134
! !
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   135
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   136
!XPathProcessor methodsFor:'processing'!
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   137
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   138
evaluate: aString
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   139
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   140
    ^self evaluate: aString inContext: documentAdaptor xpathRootContext
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   141
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   142
    "Created: / 25-10-2006 / 17:25:55 / janfrog"
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   143
!
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   144
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   145
evaluate:aString inContext:aContext 
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   146
    ^ self evaluateTree:(expressionParser parse:aString) inContext:aContext.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   147
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   148
    "Created: / 25-10-2006 / 17:28:13 / janfrog"
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   149
!
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   150
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   151
processExpression:aString
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   152
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   153
    <resource: #obsolete>
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   154
    self obsoleteMethodWarning: 'User #evaluate: instead'.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   155
    ^self evaluate:aString inContext: documentAdaptor xpathRootContext.
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   156
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   157
    "Modified: / 25-10-2006 / 17:29:25 / janfrog"
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   158
! !
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   159
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   160
!XPathProcessor class methodsFor:'documentation'!
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   161
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   162
version
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   163
    ^ '$Header: /opt/data/cvs/stx/goodies/xmlsuite/xpath/XMLv2__XPathProcessor.st,v 1.4 2007-11-16 09:20:57 vranyj1 Exp $'
5057afe1ec87 Initial import from CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   164
! !