xml - XPATH : How can I extract the contents of the "value" attribute when the "name" attribute is Name? -


मैंने इस XPath की कोशिश की है:

  // root / title [@ name = "नाम"] / @ मान   

इस XML पर:

  & lt;? Xml संस्करण = "1.0" एन्कोडिंग = "यूटीएफ -8"? & Gt ; & LT; जड़ & gt; & Lt; शीर्षक नाम = "नाम" मान = "1" & gt; विशेषता निकासी & lt; / title & gt; & Lt; शीर्षक नाम = "स्थानीय" मान = "1" & gt; विशेषता निकासी & lt; / title & gt; & Lt; / जड़ & gt;   

यह उद्देश्य के रूप में काम करने के लिए नहीं लगता है जब "नाम" विशेषता नाम है, तो मैं कैसे "मान" विशेषता की सामग्री को निकाल सकता हूँ?

अगर आप केवल value = "1" के बजाय 1 मान का उपयोग कर सकते हैं:

  string (// root / title [ @ नाम = "नाम"] / @ मान)    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -