Author Topic: World.toXML() error  (Read 8074 times)

Offline mystara

  • int
  • **
  • Posts: 79
    • View Profile
World.toXML() error
« on: August 27, 2009, 12:43:18 pm »
Hello,

I've spent a little while trying to figure out why some exported XML structures are not producing any triangles when imported. Looking at the XML files themselves, I discovered that the tag:

<triangle_list>

Is not being exported. I believe that this is a bug and has been introduced in the latest version of JPCT, since the only change I've made to my code is to start using the latest version of JPCT.
The other slightly concerning thing is that the XML importer does not seem to recognise that the XML file is invalid. Shouldn't it notice that the <triangle_list> is missing, and refuse to load it?

Cheers!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: World.toXML() error
« Reply #1 on: August 27, 2009, 02:21:01 pm »
That part actually hasn't changed for years... ??? Are you using compiled/stripped objects in your application?

Offline mystara

  • int
  • **
  • Posts: 79
    • View Profile
Re: World.toXML() error
« Reply #2 on: August 27, 2009, 02:37:48 pm »
No, not compiled or stripped.

Also, it's only the tag "<triangle_list>" which is missing. The closing tag ("</triangle_list>") is present.

Offline mystara

  • int
  • **
  • Posts: 79
    • View Profile
Re: World.toXML() error
« Reply #3 on: August 27, 2009, 03:22:56 pm »
I should also add that the triangles themselves are ALSO present. It's literally that one tag which is missing.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: World.toXML() error
« Reply #4 on: August 27, 2009, 05:10:41 pm »
It's a bug...a side effect from some memory saving that i introduced in 1.17. That combined with Config.saveMemory=true being the default in the latest version causes the problem. I've tried to fix it here: http://www.jpct.net/download/beta/jpctapi_119pre1.zip

About the importer not noticing it...that could be. It's a pretty basic parser. It will choke on tags being opened and not closed but i think it may simply ignore ones that don't open anywhere. I think i'll just live with that... ;)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: World.toXML() error
« Reply #5 on: August 28, 2009, 01:32:38 pm »
Did the fix work?

Offline mystara

  • int
  • **
  • Posts: 79
    • View Profile
Re: World.toXML() error
« Reply #6 on: August 30, 2009, 04:17:09 pm »
That seems to have fixed the problem.