RETRIVE XPATH OF AN XML ELELEMNT BY USING ITS VALUE
- by user299938
My XmlFile looks like this:
<?xml version="1.0"?>
<document-inquiry>
<publication-reference data-format="docdb" xmlns="http://www.epo.org/exchange">
<document-id>
<country>EP</country>
<doc-number>2160088</doc-number>
<kind>A1</kind>
</document-id>
</publication-reference>
</document-inquiry>
For the above xml i need to get the xpath of a specific element say for example "country element" as
My Output: "/document-inquiry/publication-reference/document-id/country"
My Input : By using its value "EP"
This is the code i tried
doc.SelectSingleNode("/document-inquiry/publication-reference/document-id[text()='EP']");
I receivev null for the above code.
I have to get it using the c# code. Can anyone pls help me on this