I have an xml file
<BookLib>
<Book Id="1">
<Title>Title1</Title>
<Author>Author1</Author>
<Publisher>Publisher1</Publisher>
<Subject />
</Book>
<Book Id="2">
<Title>Title2</Title>
<Author>Author2</Author>
<Publisher>Publisher2</Publisher>
<Subject />
</Book>
<Book Id="3">
<Title>Title3</Title>
<Author>Author3</Author>
<Publisher>Author3</Publisher>
<Subject />
</Book>
</BookLib>
I want to select book id. I tried using this
@"/BookLib/Book/Title[contains(translate(text(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'),'" + searchText + "')]/@Id";
in XPathExpression
how can i retrieve 'id' using xpath in c#
Id="1"