0

I've been searching, but can't really find an answer.

I'm working on my own Movie Collection software, where I'm using the OMDBApi (http://omdbapi.com/) and I want to implement a search function. OMDB's Response is a XML string:

<root response="True">
    <Movie Title="Pain &amp; Gain" Year="2013" imdbID="tt1980209" Type="movie"/>
    <Movie Title="No Pain, No Gain" Year="2005" imdbID="tt0306846" Type="movie"/>
    <Movie Title="Chris Rock: Bring the Pain" Year="1996" imdbID="tt0200529" Type="movie"/>
    <Movie Title="Confession of Pain" Year="2006" imdbID="tt0834902" Type="movie"/>
    <Movie Title="Laugh at My Pain" Year="2011" imdbID="tt1999192" Type="movie"/>
    ...
</root>

I've tried with XElement.Parse etc, but I can't find a way to get the attributes.

XML has never been my strongest side, it wouldn't be a problem if the response string was in different nodes like <Title></title> <Year></Year>. But to get attributes..

1 Answer 1

0

You can try like this answer

LINQ to XML technology very useful to work with XML Data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.