Plugins: Read local xml files
|Assignee:||Andreas Smas||% Done:|
|Found in version:||3.3.223||Platform:||Linux|
Read a XML file from a local path or from plugin.path
#1 Updated by andreus sebes over 9 years ago
I'm sorry the problem is not reading the files. I tested with local path, with plugin.path and with smb path.
The error in parsing to XML.
var upath="LOCAL OR PLUGIN OR SMB PATH";
var xTest = new XML(showtime.readFile(upath).toString());
Returns the error "Syntax Error: xml is a reserved identifier"
Note you can close bug 782, since is the same problem that this one
#4 Updated by andreus sebes over 9 years ago
Ok. Problem solved.
Googling i discover that is a bug of XML, if you do this workaroud it works :)
sXML = sXML.replace(/^[\s\S]*?(<[^\?!])/, "$1");
Sorry for the problem
#5 Updated by andreus sebes over 9 years ago
Ok, The readFile() method is not available in (correctly built) release versions of Showtime. Why? Because I don't want plugins to be able to read all sorts of files from peoples system and upload that stuff anywhere on the internet.
But then you can only read xml files from http. SMB requires readFile().
Can't you only permit readFile() in SMB and inside the zipped plugin and not in whole local system?