Switch to full style
Thank you for reporting them.
Post a reply

XML export

Wed May 11, 2022 10:07 pm

Hi,

Have you made some other changes to the XML export function? There seems to be some strange behaviour in the 'Location' field...

Most files work fine, they have :

<Location>\\SERVER\Folder\Filename</Location>

as you would expect, but it looks like some are picking up a bit of code instead :

<Location><![CDATA[\\SERVER\Folder\Filename]></Location>

At first glance it looks like it happens when there is an apostrophe ' in the filename, but there might be other instances as well.

(I import the XML into Excel and have some code parse it into a list there, and it was crashing because Excel imports those fields as blanks - it also seems that Predicted_Rating has turned into Predicted but that's not a big problem :D)

Thanks,

Re: XML export

Wed May 11, 2022 10:20 pm

Nope, I haven't made changes. Those CDATA were there before and they are needed to escape characters that could be confused with XML markups.

https://stackoverflow.com/questions/2784183/what-does-cdata-in-xml-mean

https://www.educba.com/xml-cdata/

I'm surprised that Excel crashes, but unfortunately I can't test because I don't have it on my computer.

Maybe my use of CDATA isn't 100% correct. Can you make the test with an XML file that contains some escaped characters but that imports fine into Excel, and see how it's using a different syntax from mine?

Re: XML export

Wed May 11, 2022 10:28 pm

I think I know why Excel crashes...

You have

<Location><![CDATA[\\SERVER\Folder\Filename]></Location>

when you should have

<Location><![CDATA[\\SERVER\Folder\Filename]]></Location>

I will look at my code, it's probably a bug on my part that has never been detected before.

Now it's bedtime for me, see you tomorrow!

Re: XML export

Wed May 11, 2022 10:30 pm

Are you sure you have <Location><![CDATA[\\SERVER\Folder\Filename]></Location>

My code seems correct as it includes the ]] at the end...

Re: XML export

Wed May 11, 2022 11:02 pm

sleep well :D

sorry - that was a copy/paste error on my part, it does have the ]] at the end.

it looks like the XML import is working fine - the data seems to be translated into 'correct' data without the 'CDATA' codeword. It is my code that errors out - it is expecting to find Location data in a particular row but instead finds a blank cell - and Left(String, Num) throws an error when String is empty...

Something has changed, because it worked before; I will have a deeper dive into it tomorrow, and see if I can figure out what is happening. It's quite likely it's just some kludge in my code that no longer functions properly...it's in the code related to 'expanding' the non-IMDB files that i store as episodes of some movie file with a particular tag, into the individual movie files for my list...

Re: XML export

Thu May 12, 2022 10:58 pm

OK; so the problem appears to be that previously, when the XML was imported into Excel, each element for an item was on the same row (so,header, title, orignal title, predicted_rating etc.), were on the same row in excel (basically making a table).

However now, instead each of those elements appears on it's own row (so title is on row 2 on it's own, original title on row 3 on it's own, etc., with only the 'header' field appearing on each row in the first column.

I don't know if it's Excel or the app that's the issue - is there an old version of the program accessible anywhere? I could try the XML output from a version that's a couple of months old, and that would tell me if Excel has changed or Coollector...

If not I could work around it in my code, or perhaps my googling around XML and excel will produce an answer :D

Thanks,

Re: XML export

Thu May 12, 2022 11:31 pm

Ok, after a bit more experimenting with smaller lists, it seems the problem only arises when one of the films in the XML list is unrated.

For rated films, the XML element is e.g <Rated>excellent</Rated>
But for unrated films, instead it is <Watched>false</Watched>

with a bit more experimenting, if I take a list with one <Watched></Watched> element and all the rest <Rated></Rated>, the whole file imports incorrectly - but if I edit the XML so that one tag becomes <Rated></Rated> instead - it works fine.

And it also works if I replace 'Rated' with 'Watched' for all the other items. So it looks like the problem is because the elements are different between items.

If that's the intended behaviour of course, then I can work around it :D

(edit to add a small addendum - if I do a find and replace in the XML of the full list of movies to replace Rated> with Watched> - everything works perfectly.)

Thanks,
Last edited by Orclev on Thu May 12, 2022 11:40 pm, edited 1 time in total.

Re: XML export

Thu May 12, 2022 11:39 pm

Orclev wrote:So it looks like the problem is because the elements are different between items.

Makes sense. I'll make the change with the new version, normally this week-end.

Re: XML export

Thu May 12, 2022 11:41 pm

that's excellent, thanks (especially since I may be the only person actually doing this :D)
Post a reply