XMLSetting Bug

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
Blazer
GamingTools Subscriber
Posts: 38
Joined: Tue Jul 20, 2004 8:22 am

XMLSetting Bug

Post by Blazer » Sat Jun 04, 2005 10:25 pm

Test.xml

Code: Select all

<?xml version='1.0'?>
<InnerSpaceSettings NextID="2">
	<Set ID="1" Name="TestCategory">
		<Setting Name="uppercase">Some Test Value</Setting>
	</Set>
</InnerSpaceSettings>
Test.iss

Code: Select all

; Test Script

function main&#40;&#41;
&#123;
	declare TestValue string local Some Test Value

	XMLSetting -unload "Test.xml"
	XMLSetting -load "Test.xml"

	XMLSetting -set "Test.xml" "TestCategory" "UPPERCASE" "$&#123;TestValue&#125;"
	XMLSetting -save "Test.xml"
	
	echo $&#123;XMLSetting["Test.xml","TestCategory","UPPERCASE","No Value"]&#125;

	XMLSetting -get "Test.xml" "TestCategory" "UPPERCASE"
&#125;
Output

Code: Select all

-unload loaded
-save saved
NULL
Some Test Value
Several issues with the above:)
1) The -unload and -save output should be more meaningful
2) My UPPERCASE is getting converted to lowercase in the xml file
3) Why is the echo ${XMLSetting.... generating a NULL?

Blazer
GamingTools Subscriber
Posts: 38
Joined: Tue Jul 20, 2004 8:22 am

Post by Blazer » Sat Jun 04, 2005 10:40 pm

Also another 2 things.
If the .xml file does not exist, and I use;

Code: Select all

XMLSetting -set etc..
It shouldnt generate a error. It seems I need to do the following to create the file first.

Code: Select all

XMLSetting -load etc..
Wouldnt it be better if the xml files are created by default in the scripts folder, without specifying a path?:)

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Sun Jun 05, 2005 1:03 am

1) The -unload and -save output should be more meaningful
Bug, fixed in next version, thanks
2) My UPPERCASE is getting converted to lowercase in the xml file
working as intended - the set and setting names are case insensitive, and this is just some optimization. I cant think of a reason why it would really matter that your set and setting name capitalizations are lost?
3) Why is the echo ${XMLSetting.... generating a NULL?
The XMLSetting TLO was removed in the first release of 0.94 (as explained in the changelog), replaced with SettingXML which is used differently. Setting TLOs can be found here: http://www.lavishsoft.com/wiki/index.ph ... Settings_3
It shouldnt generate a error. It seems I need to do the following to create the file first.
The new preferred method is just to use SettingXML and its methods, rather than the XMLSetting command which is mostly there for convenience. SettingXML will automatically create for you.
Wouldnt it be better if the xml files are created by default in the scripts folder, without specifying a path?
IMHO, no. I can only speak for myself but if I just wanted to create an XML settings file for some reason, I'd prefer it be in the main folder, not forced to be in scripts. However, I do think this should be configurable, and I'll see that it becomes so :)

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Sun Jun 05, 2005 1:07 am

I should add:
The XMLSetting command will probably be revised to make it simpler and much more in line with the SettingXML object

Post Reply