From 360713b5c2c34ac9bf32b5561fefa93a96722133 Mon Sep 17 00:00:00 2001 From: zhengchun Date: Sat, 30 Mar 2024 22:40:42 +0800 Subject: [PATCH] minor fix --- build.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.go b/build.go index 0c0be78..45ae702 100644 --- a/build.go +++ b/build.go @@ -125,6 +125,7 @@ func (b *builder) processAxis(root *axisNode, flags flag, props *builderProp) (q // Skip the current node(Self:false) for the next descendants nodes. _, ok := qyGrandInput.(*contextQuery) qyOutput = &descendantQuery{name: root.LocalName, Input: qyGrandInput, Predicate: filter, Self: ok} + *props |= builderProps.NonFlat return qyOutput, nil } } else if ((flags & flagsEnum.Filter) == 0) && (root.AxeType == "descendant" || root.AxeType == "descendant-or-self") { @@ -158,7 +159,7 @@ func (b *builder) processAxis(root *axisNode, flags flag, props *builderProp) (q } return v } - if (*props & builderProps.NonFlat) != builderProps.None { + if (*props & builderProps.NonFlat) == 0 { qyOutput = &childQuery{name: root.LocalName, Input: qyInput, Predicate: filter} } else { qyOutput = &cachedChildQuery{name: root.LocalName, Input: qyInput, Predicate: filter}