如何获取当前节点的父节点名称?
获取当前节点的父节点名称的正确语法是什么?我知道它与 AxisName 父级有关,但正确的语法是什么? 例如,以下
<netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2" location="file:/dev/null" iosp="lasp.tss.iosp.ValueGeneratorIOSP" start="0" increment="1">
<attribute name="title" value="Vector time series"/>
<dimension name="time" length="100"/>
<variable name="time" shape="time" type="double">
<attribute name="units" type="String" value="seconds since 1970-01-01T00:00"/>
</variable>
<group name="Vector" tsdsType="Structure" shape="time">
<variable name="x" shape="time" type="double"/>
<variable name="y" shape="time" type="double"/>
<variable name="z" shape="time" type="double"/>
</group>
</netcdf>
元素变量的 xml 我应该获取 netcdf 或 group。提前致谢。
what's the right syntax to get the current node's parent node's name? I know it's about the AxisName parent but what's the right syntax?
for example of the following xml
<netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2" location="file:/dev/null" iosp="lasp.tss.iosp.ValueGeneratorIOSP" start="0" increment="1">
<attribute name="title" value="Vector time series"/>
<dimension name="time" length="100"/>
<variable name="time" shape="time" type="double">
<attribute name="units" type="String" value="seconds since 1970-01-01T00:00"/>
</variable>
<group name="Vector" tsdsType="Structure" shape="time">
<variable name="x" shape="time" type="double"/>
<variable name="y" shape="time" type="double"/>
<variable name="z" shape="time" type="double"/>
</group>
</netcdf>
for the element variable I should get netcdf or group. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用:
..
缩写是parent::node()
的简写。请注意:并非每个家长都有名字。例如,文档节点 (
/
) 是文档顶部元素 (/*
) 的父节点,并且没有名称。Use:
The
..
abbreviation is a shorthand forparent::node()
.Do note: Not every parent has a name. For example the document node (
/
) is the parent of the top element (/*
) of the document and has no name.name(parent::*)
应该这样做。显然,只有一位父母。name(parent::*)
should do it. There's only going to be one parent, obviously.