xml - MICROSOFT.XMLDOM -- selecting a node that contains a specific node -


यहां एक्सएमएल से एक उद्धरण है:

  & lt;? Xml संस्करण = "1.0 "एन्कोडिंग =" यूटीएफ -8 "? & Gt; & LT; usa_map_locator & gt; & LT; map_data & gt; & LT; राज्य & gt; & LT; आईडी & gt; 2 & lt; / आईडी & gt; & LT; लिंक / & gt; & Lt; / राज्य & gt; & LT; राज्य & gt; & LT; आईडी & gt; 3 & lt; / आईडी & gt; & LT; लिंक / & gt; & Lt; / राज्य & gt; & Lt; / map_data & gt; & Lt; / usa_map_locator & gt;  

मुझे राज्य 2 (या 3 या 4 या 5 और इसी तरह) के लिए लिंक नोड में एक मान देना होगा। मैं स्रोत एक्सएमएल पढ़ने के लिए माइक्रोसॉफ्ट। एक्सएमएलडीएम ऑब्जेक्ट का उपयोग कर रहा हूं और इसे पूरा करने के लिए सही विधि (ओं) की आवश्यकता है।

itemprop = "text">

doc.selectSingleNode ("/ usa_map_locator / map_data / state / id [। = '2'] :: पैरेंट () / लिंक")। InnerText = "link value";


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

jquery - SimpleModal Confirm fails to submit form -