Scolring - Forum

Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology

Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered

You are not logged in.

#1 7-Nov-2014 19:46:03

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,541
Website

[solved] detecting bad/corrupt/other problematic .xos file

how to get the vm to realize an .xos file is corrupt or is filled with the wrong information, is empty, etc:

fun cbProjectLoaded(project, p)=
//see if is has a 'scene' xml node. I guess other xml files have a node named 'scene' in them, but they probably don't have the .xos extension...
let XMLgetMarkByValue project.PRJ_xmlFile "scene" -> xmlfile_evaluate in
(	if  xmlfile_evaluate == nil then
			(
				_DLGMessageBox _channel mainWindow.EDW_win "corrupte" "corrupt" 0;
				0;
			)
			else
			(
    	  		_fooS "projected has been loaded, triggering plugloaded callback";
    	  		_rfltimer _starttimer _channel 100 @cbPlugLoaded p;
    	  		0;
  			);

);
 0;;

Last edited by hebdemnobad (7-Nov-2014 20:32:00)

Offline

#2 7-Nov-2014 19:50:18

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,541
Website

Re: [solved] detecting bad/corrupt/other problematic .xos file

a shorter way to put the question...

how can scol query the variable loadedProject to see whether it is a valid os3d .xos file?

or

how can the vm display to the user what the log says:

XMLPARSER WARNING : the XML content contain an error and will be loaded manually
//this is the path of the fake project:
krono3 lexiviewlocal/bib.xos

Last edited by hebdemnobad (7-Nov-2014 20:21:30)

Offline

#3 7-Nov-2014 23:26:26

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: [solved] detecting bad/corrupt/other problematic .xos file

Yes when the XML standard is not respected or if the file contains an error (incomplete, or badformated) the xmltools try to parse it anyway.
This is because at the beginning I forgot to manage xml marks or parameter names started with numbers. So it was working for XOS files but it was not standard so it will fail with the tinyXml loader.

Offline

Board footer

Powered by FluxBB