开发者

TinyXPath not filtering the required dom element according to the given attribute query?

Example XML is:

  <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-517开发者_JAVA技巧5-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>

When my query contains the XPath "dgn/sg/nodes/node[@type='MESH']" it should give me onle one node but it selects both the nodes(Sphere 1 and Circle 1). This does not happens if i change the dom Element name from "node" to something else in the xml i.e. if i rename the "node" to "abc" and then query like this XPath "dgn/sg/nodes/abc[@type='MESH']" it filters the desired dom element i.e. it gives only Sphere 1. It does not happen with any dom element with name other than "node". Is node a keyword in TinyXpath or something else???

Why does it happens with Dom Element named "node"????

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜