Skip to content

Commit 032ab99

Browse files
committed
Update XPathParser#get_first and XPathParser#predicate to both setup document
1 parent c178cf8 commit 032ab99

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/rexml/xpath_parser.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ def parse path, node
8888
node = node.first
8989
end
9090

91-
@document = node.document
9291
match(path_stack, node)
9392
end
9493

9594
def get_first path, node
9695
path_stack = @parser.parse( path )
96+
@document = node.document
9797
first( path_stack, node )
9898
end
9999

@@ -149,6 +149,7 @@ def first( path_stack, node )
149149

150150

151151
def match(path_stack, node)
152+
@document = node.document
152153
nodeset = [node]
153154
result = expr(path_stack, nodeset)
154155
case result

0 commit comments

Comments
 (0)