2011-12-05 128 views
0

我想知道map是什麼的名字的值。 我不想迭代,然後找到。有沒有什麼辦法可以爲xpath編寫相同的?爲兄弟節點找到xpath

對於具有map = sec2的節點,xpath是什麼?請找到下面的xml。

<section-meta-data> 
      <section> 
       <name>Applicant Info</name> 
       <map>sec1</map> 
      </section> 
      <section> 
       <name>prior-insurance-coverage</name> 
       <map>sec3</map> 
      </section> 
      <section> 
       <name>hipaa-guarantee-issue-coverage</name> 
       <map>sec2</map> 
      </section> 
      <section> 
       <name>medical-info</name> 
       <map>sec7</map> 
      </section> 
      <section> 
       <name>medications</name> 
       <map>sec4</map> 
      </section> 
     </section-meta-data> 
+1

..是答案:) –

回答

1

使用下面的表達式:

/section-meta-data/section[map='sec2']/name 
相關問題