Topic: API/xml error in Transformers

Hi all,

I'm developing in C#. As i try to load the xml given from the API for Transformers (2007 - id # 1858), i get an error in the following line (# 145):

<person url="http://www.themoviedb.org/person/17341" name="Amaury Nolasco" character="ACWO Jorge "Fig=""" Figueroa" job="Actor" id="17341" thumb=""/>

As far as i can tell, it should instead partly read: ... character="ACWO Jorge" Fig="Figueroa" ...

Is it an error in the xml code, a fault in .Net XmlDocument.LoadXml() or im i missing someting?

Best regards,

Daniel


... and a B I G thanks to Travis and all other developers!

Re: API/xml error in Transformers

That one is a little weird... I'll take a look at it tonight.

Travis Bell
themoviedb.org | The open movie database
Follow TMDb on Twitter
Found a bug? Got a feature request? Check our Lighthouse first.

Re: API/xml error in Transformers

Line # 76 for Terminator 2 has the same error:

<person url="http://www.themoviedb.org/person/1100" name="Arnold Schwarzenegger" character="The Terminator "T800="""" job="Actor" id="1100" thumb="http://images.themoviedb.org/profiles/223/222741_Arnold-Schwarzenegger-Posters_thumb.jpg"/>


Best regards,

Daniel

Re: API/xml error in Transformers

Hey Daniel,

The error happens where there is some UTF-8 escaped characters. The data the API is returning is fine, must have something to do with the way your library is parsing the XML.

Here's an example of what the API is outputting for Transformers:

<person url="http://www.themoviedb.org/person/17341" name="Amaury Nolasco" character="ACWO Jorge &quot;Fig&quot; Figueroa" job="Actor" id="17341" thumb=""/> 

I haven't heard anyone else have this problem, are you using a standard XML parsing library?

Travis Bell
themoviedb.org | The open movie database
Follow TMDb on Twitter
Found a bug? Got a feature request? Check our Lighthouse first.

Re: API/xml error in Transformers

Hi Travis,

It was my code all the way. Now it looks like this:

WebClient wc = new WebClient();
wc.Encoding = System.Text.Encoding.UTF8; //<- added this
string tmp = wc.DownloadString(aUrl);
return tmp;//HttpUtility.HtmlDecode(tmp); //<- and removed this

The two changes above made it all work. Hav no idea why it looked like it did. Wrote/copied that some years ago and it has worked fine since. Until now that is, but now everything is working again.

Thanks for the fast reply!

/ Daniel

Last edited by dntmdb (2010-02-09 09:13:14)

Re: API/xml error in Transformers

Great!

Travis Bell
themoviedb.org | The open movie database
Follow TMDb on Twitter
Found a bug? Got a feature request? Check our Lighthouse first.