22

現在のノードの親ノードの名前を取得する正しい構文は何ですか? 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 または group を取得する必要があります。前もって感謝します。

4

2 に答える 2

40

使用:

name(..)

省略形はの..省略形ですparent::node()

注意: すべての親に名前があるわけではありません。たとえば、ドキュメント ノード ( /) はドキュメントの最上位要素 ( ) の親であり、/*名前はありません。

于 2011-08-11T12:41:43.893 に答える
11

name(parent::*)するべきです。明らかに、親は1人だけになります。

于 2011-08-11T08:40:05.993 に答える