获取当前节点的父节点名称的正确语法是什么?我知道它是关于AxisName的父类,但是什么是正确的语法? 例如下面的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>
为元素可变我应该得到的NetCDF或基团。提前致谢。
好问题,+1。查看我的答案,获取最短可能的XPath表达式,该表达式的计算结果为当前节点的父节点的名称。也是为什么父母可能没有名字的解释。最后,这真的是一个XPath问题,而不是XSLT问题。 –