gpt4 book ai didi

c# - 仅当子元素具有特定数量的元素时才选择父元素

转载 作者:数据小太阳 更新时间:2023-10-29 02:57:54 25 4
gpt4 key购买 nike

我正在尝试获取所有 <Opening>标记其 <PlanarGeometry><Polyloop>有数量 CartesianPoint > 4.

Xml 标记表面是另一个的子标记。

<Surface id="su-137" surfaceType="InteriorWall" constructionIdRef="ASHIW23" xmlns="http://www.gbxml.org/schema">
<Name>W-106-114-I-W-137</Name>
<Opening id="su-137-op-1" openingType="NonSlidingDoor" constructionIdRef="MDOOR">
<Name>W-106-114-I-W-137-D-1</Name>
<PlanarGeometry>
<PolyLoop>
<CartesianPoint><Coordinate>55.570238</Coordinate><Coordinate>92.571596</Coordinate>
<Coordinate>0.000000</Coordinate></CartesianPoint><CartesianPoint> <Coordinate>55.570238</Coordinate><Coordinate>92.571596</Coordinate><Coordinate>6.666667</Coordinate>
</CartesianPoint>
<CartesianPoint>
<Coordinate>55.570238</Coordinate><Coordinate>95.571596</Coordinate><Coordinate>6.666667</Coordinate></CartesianPoint>
<CartesianPoint>
<Coordinate>55.570238</Coordinate><Coordinate>95.571596</Coordinate><Coordinate>0.000000</Coordinate>
</CartesianPoint>
</PolyLoop>
</PlanarGeometry>
</Opening>
</Surface>

我从中得到的引用很少 - Xpath to select only nodes where child elements exist? SO 线程并从下面的示例中得到了很少的帮助。

book[author/degree]
All <book> elements that contain <author> children that in turn contain at least one <degree> child.

如何使用 xPath 或其他方式实现此目的???

最佳答案

I am trying to fetch all <Opening> tag whose <PlanarGeometry>'s <Polyloop> has number of CartesianPoint > 4.

假设 Surface element 是您当前的上下文节点:

gb:Opening[gb:PlanarGeometry/gb:Polyloop[count(gb:CartesianPoint) > 4]]

gb前缀需要映射到 http://www.gbxml.org/schema命名空间 URI。这将选择所有 Opening至少包含一个 Polyloop 的元素超过 4 CartesianPoint children 。

关于c# - 仅当子元素具有特定数量的元素时才选择父元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14457938/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com