summaryrefslogtreecommitdiff
path: root/xmake/core/base/xml.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/base/xml.lua')
-rw-r--r--xmake/core/base/xml.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/xmake/core/base/xml.lua b/xmake/core/base/xml.lua
index 2aa4036b8..84da8e16b 100644
--- a/xmake/core/base/xml.lua
+++ b/xmake/core/base/xml.lua
@@ -385,9 +385,12 @@ function xml.find(node, path)
end
local segments = path:split("/", {strict = true})
local current = {node}
- for _, segment in ipairs(segments) do
+ for idx, segment in ipairs(segments) do
local next_level = {}
for _, parent in ipairs(current) do
+ if parent.name == segment then
+ table.insert(next_level, parent)
+ end
if parent.children then
for _, child in ipairs(parent.children) do
if child.name == segment then
@@ -395,6 +398,13 @@ function xml.find(node, path)
end
end
end
+ if parent.prolog then
+ for _, child in ipairs(parent.prolog) do
+ if child.name == segment then
+ table.insert(next_level, child)
+ end
+ end
+ end
end
if #next_level == 0 then
return nil