[FIXED] Can't parse exported XML file?

already fixed bugs

Moderator: AniDB

Locked
Xinil
Posts: 6
Joined: Tue Apr 11, 2006 3:56 pm

[FIXED] Can't parse exported XML file?

Post by Xinil »

So I've tried parsing (using PHP) the XML file that you guys provide through your export feature...and I've had no luck. I've tried parsing the examples too, but those fail also.

I wrote my own parser and I thought perhaps I did something wrong, so I tried free demo parsers around the net, those didn't work either.

File attempted to parse: http://anidb.info/export/examples/xml/mylist.xml

Parsing demos:

http://keithdevens.com/software/phpxml/xml-to-php

and

http://www.magicparser.com/demo

If you paste the mylist.xml link into either of those, they both fail. I tried my own parser too, and it can't get past the first item. Also tried parsing the xml-dark, plain and whatnot.

Any help?
PetriW
AniDB Staff
Posts: 1522
Joined: Sat May 24, 2003 2:34 pm

Post by PetriW »

The file in question uses a xsl stylesheet, which neither can handle, strip out the xsl-stylesheet header and try again on this:
http://keithdevens.com/software/phpxml/xml-to-php
Xinil
Posts: 6
Joined: Tue Apr 11, 2006 3:56 pm

Post by Xinil »

Thanks for the quick reply Petri. I took out the xsl header and it successfully parsed the file but it can't use the item elements correctly (not in my parser, keith deven's, or magicparser.com).

Here's the file without the XSL: http://www.xinil.net/temp/anidbXML.xml

Edit: Seems it was because I didn't save the edited file in UTF-8. All good now. Thanks :)
Xinil
Posts: 6
Joined: Tue Apr 11, 2006 3:56 pm

Post by Xinil »

I should also mention that when I try exporting my list, it doesn't give me a direct download link anymore (after i get the message saying it's ready to download.

---

Your scheduled Mylist Export was just created and is now ready for download.

Template: xml-plain
Requested at: 22.02.2007 18:23
Finished at: 22.02.2007 20:21

Direct Download:

--

Looking at the HTML, i'm provided with:

Direct Download: <a href="http://anidb.info/export/"></a>

---

Looking at the hidden form too:

<input type="hidden" name="msg.body" value="Your scheduled Mylist Export was just created and is now ready for download.

Template: xml-plain
Requested at: 22.02.2007 18:23
Finished at: 22.02.2007 20:21

Direct Download: <a href="http://anidb.info/export/"></a>

" />
Rar
AniDB Staff
Posts: 1471
Joined: Fri Mar 12, 2004 2:41 pm
Location: UK
Contact:

Post by Rar »

Ehehe, PHP SUX SO MUCH IT HURTS.

Rar
PetriW
AniDB Staff
Posts: 1522
Joined: Sat May 24, 2003 2:34 pm

Post by PetriW »

Well, instead of reinventing the wheel you could test actually making a new export template instead... Granted by what I see here I have little hope of success...

You should probably try something easier before tackling this.
exp
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post by exp »

Xinil wrote:I should also mention that when I try exporting my list, it doesn't give me a direct download link anymore (after i get the message saying it's ready to download.
mylist exports were broken after the last anidb update.
should be fixed now.

BYe!
EXP
Xinil
Posts: 6
Joined: Tue Apr 11, 2006 3:56 pm

Post by Xinil »

PetriW wrote:Well, instead of reinventing the wheel you could test actually making a new export template instead... Granted by what I see here I have little hope of success...

You should probably try something easier before tackling this.
Thanks for the friendly words of encouragement. I've already programmed a feature into my site that successfully imports your XML file.

Good day.
Locked