I have the following xml file as output from a program:
<?xml version='1.0' encoding='ISO-8859-1'?>
<rsp stat='ok'>
<results total='5'>
<result cover='http://ia.media-imdb.com/images/M/MV5BMjMyOTM4MDMxNV5BMl5BanBnXkFtZTcwNjIyNzExOA@@._V1._SX54_CR0,0,54,74_.jpg' title='The Amazing Spider-Man 'year='2012' director='Marc Webb' rating='7.3' details='/title/tt0948470/' />
<result cover='http://i.media-imdb.com/images/SF1f0a42ee1aa08d477a576fbbf7562eed/realm/feature.gif' title='The Amazing Spider-Man 2 'year='2014' director='Marc Webb' rating='N.A.' details='/title/tt1872181/'/>
<result cover='http://ia.media-imdb.com/images/M/MV5BMzk3MTE5MDU5NV5BMl5BanBnXkFtZTYwMjY3NTY3._V1._SX54_CR0,0,54,74_.jpg' title='Spider-Man 'year='2002' director='Sam Raimi' rating='7.3' details='/title/tt0145487/'/>
<result cover='http://ia.media-imdb.com/images/M/MV5BODUwMDc5Mzc5M15BMl5BanBnXkFtZTcwNDgzOTY0MQ@@._V1._SX54_CR0,0,54,74_.jpg' title='Spider-Man 3 'year='2007' director='Sam Raimi' rating='6.3' details='/title/tt0413300/'/>
<result cover='http://ia.media-imdb.com/images/M/MV5BMjE1ODcyODYxMl5BMl5BanBnXkFtZTcwNjA1NDE3MQ@@._V1._SX54_CR0,0,54,74_.jpg' title='Spider-Man 2 'year='2004' director='Sam Raimi' rating='7.5' details='/title/tt0316654/'/>
</results>
</rsp>
But when i save it as xml file and open it in browser it shows attribute construct error. WHY ??
You have to separate attribute values from the names of other attributes with whitespace characters. Notice that
yearimmediately follows the value oftitle. You simply misplaced a couple of spaces.title='The Amazing Spider-Man 'year='2012'You have to change it to
title='The Amazing Spider-Man' year='2012'The following document should render properly.