के साथ एक एक्सएमएल दस्तावेज़ पर XPath मेरे पास इस XML दस्तावेज़ को नेमस्पेस के साथ है और मैं XPath का उपयोग करके कुछ नोड्स निकालना चाहता हूं।नामस्थान
<ArrayOfAnyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
<anyType xsi:type="Document">
<Id>5</Id>
<Title>T1</Title>
</anyType>
<anyType xsi:type="Document">
<Id>15</Id>
<Title>T15</Title>
</anyType>
</ArrayOfAnyType>
क्या है XPath अभिव्यक्ति अगर मैं xsi के साथ सभी "anytype" तत्वों निकालना चाहते हैं होने जा रहा: type = "दस्तावेज़"
यहाँ दस्तावेज़ है?
मैं इस की कोशिश की है:
//anyType[@xsi:type="Document"]
और यह काम नहीं करता:
xpath का कौन सा संस्करण उपयोग कर रहे हैं? xpath संस्करण अलग-अलग नामस्थानों को संभालते हैं? –
ऐसा लगता है कि मुझे यह कहना है: '// xmlns: anyType [@xsi: type = "document"]' इसे काम करने के लिए – EnToutCas
डुप्ड: - http://stackoverflow.com/questions/536441/xpath-namespace- ड्राइविंग -मे-पागल - http://stackoverflow.com/questions/11345/xpaths-and-default-namespaces - http://stackoverflow.com/questions/103576/whats-wrong-with-my-xpath-xml – annakata