示例 XML 是:
<dgn>
<sg>
<nodes>
<node name="Sphere 1" clsid="{CF21F965-203A-456A-83FE-A5F62D6D8E50}" type="MESH" id="{418ACDD5-65D2-410F-B43B-0B48E4010B75}" subtype="" version="2.0" cloneparentkey="" nextcloneparentkey="">
<object id="{AC685AD2-3411-43B0-A29B-3B22086BAEF6}">Sphere 1</object>
<material id="{D2029F35-4A85-4669-BBF3-E754568ED88C}">Standard 1</material>
<controllers>
<controller id="{989803FD-B575-45E4-B8A0-B5E69008145B}" weight="100" name="DEFAULT" inherit="-1">
<tracks>
<track name="radius" type="PARAMETRIC" numkey="0" pathfollow="0">
<interpolator clsid="{ECC9C2C7-5175-4784-9108-1FA4C25D3383}" type="FLOAT">
<key frame="-1">75.000000,0.000000,0.000000,0.000000</key>
</interpolator>
</track>
</track>
<track name="scale" type="SRTV" numkey="101" pathfollow="0">
<interpolator clsid="{ECC9C2C7-5175-4784-9108-1FA4C25D3383}" type="FLOAT3">
<key frame="-1">1.000000,1.000000,1.000000,1.000000</key>
</interpolator>
</track>
<track name="rotation" type="SRTV" numkey="102" pathfollow="0">
<interpolator clsid="{ECC9C2C7-5175-4784-9108-1FA4C25D3383}" type="FLOAT3">
<key frame="-1">0.000000,0.000000,0.000000,0.000000</key>
</interpolator>
</track>
</tracks>
</controller>
</controllers>
<customdata>
<offsetmatrix>1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1</offsetmatrix>
<poslinkvector>0.000000,0.000000,0.000000,0.000000</poslinkvector>
</customdata>
</node>
<node name="Circle 1" clsid="{CF21F965-203A-456A-83FE-A5F62D6D8E50}" type="SHAPE" id="{418ACDD5-65D2-410F-B43B-0B48E4010B75}" subtype="" version="2.0" cloneparentkey="" nextcloneparentkey="">
<object id="{AC685AD2-3411-43B0-A29B-3B22086BAEF6}">Sphere 1</object>
<material id="{D2029F35-4A85-4669-BBF3-E754568ED88C}">Standard 1</material>
<controllers>
<controller id="{989803FD-B575-45E4-B8A0-B5E69008145B}" weight="100" name="DEFAULT" inherit="-1">
<tracks>
<track name="radius" type="PARAMETRIC" numkey="0" pathfollow="0">
<interpolator clsid="{ECC9C2C7-5175-4784-9108-1FA4C25D3383}" type="FLOAT">
<key frame="-1">75.000000,0.000000,0.000000,0.000000</key>
</interpolator>
</track>
</track>
<track name="scale" type="SRTV" numkey="101" pathfollow="0">
<interpolator clsid="{ECC9C2C7-5175-4784-9108-1FA4C25D3383}" type="FLOAT3">
<key frame="-1">1.000000,1.000000,1.000000,1.000000</key>
</interpolator>
</track>
<track name="rotation" type="SRTV" numkey="102" pathfollow="0">
<interpolator clsid="{ECC9C2C7-5175-4784-9108-1FA4C25D3383}" type="FLOAT3">
<key frame="-1">0.000000,0.000000,0.000000,0.000000</key>
</interpolator>
</track>
</tracks>
</controller>
</controllers>
<customdata>
<offsetmatrix>1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1</offsetmatrix>
<poslinkvector>0.000000,0.000000,0.000000,0.000000</poslinkvector>
</customdata>
</node>
</nodes>
</sg>
</dgn>
当我的查询包含 XPath“dgn/sg/nodes/node[@type='MESH']”时,它应该只给我一个节点,但它会同时选择两个节点(Sphere 1 和 Circle 1)。如果我将 dom 元素名称从“node”更改为 xml 中的其他名称,即如果我将“node”重命名为“abc”然后像这样查询 XPath“dgn/sg/nodes/abc[@type ='MESH']" 它过滤了所需的 dom 元素,即它只给出 Sphere 1。它不会发生在任何名称为“node”以外的 dom 元素上。node 是 TinyXpath 中的关键字还是别的什么???
为什么它会发生在名为“node”的 Dom Element 上????