View Full Version : XML module, command description?
Michael Hartlef
30-06-2007, 13:07
Hi Eros,
is it possible for you to post the commands with the parameter description for the XML module?
ErosOlmi
30-06-2007, 22:01
Yes, sure. I will try to work on it tomorrow.
XML module was something developed ages ago. It is a home made module using linked list to load all XML file nodes. So quite sure it will manaeg just basis of XML.
I will document it. But if you need something really serious on XML I will try to wrap MS XML COM server.
In the meantime, if you have an XML file to test, please send me and I will create a demo script.
Ciao
Eros
Michael Hartlef
30-06-2007, 22:31
Thanks Eros,
I have no test script/file. I was more thinking about if I export from Blender, how we gonna read xml files for TBGL? That was the motivation I asked.
Mike if you could export as ini files that would be the easiest. Ini file routines are really great and make life easy.
Ini very simple, straightforward. Is like a super simple XML. The only drawback is if you need data that is in multiple lines, like a long block of text
Ini doesn't handle that too well. Of course you could write how many lines as an ini name and then write each line out accordingly. This might still be easier than
using XML.
XML can't really be automated. I always thought that all the work you put into the XML file, was made up for by anyone being able to read it and use it. But this is not the case. You have to know what is in the XML file and write your routines accordingly. I think INI is so much more easier to use and to go and edit by hand if you want to make a simple change.
I looked at XML databases this week, I think a good old csv file is so much easier. I really don't know why xml is so popular, when we had these other good systems.
Michael Hartlef
01-07-2007, 07:29
Eros: Forget about XML, Kent doesn't want to use it.
I am not against Mike. If you think XML would be easier and more manageable then that could be the tool to use. But I will write an ini sample later today.
If it doesn't look right to you then of course go with XML :)
ErosOlmi
02-07-2007, 09:12
I was making some tests with XML module. I'm quite on the idea to abandon it and make another one. Current one is really poor and do not support many XML options.
Eros
ErosOlmi
02-07-2007, 18:14
It seems I was able to bind the full MSXML set of functionalities thanks to José Roca help here: http://www.jose.it-berater.org/smfforum/index.php?board=46.0
I've also implemented a new way to call external functions and subs that needs VARIANT data type passed BYVAL. This is the case of many COM components.
Module XML will not exist anymore. It will be substituted by an include source file. This will simplify a lot documentation and also will follow MS standards. I suppose nice scripts will be possible using XML like making RSS feeds and news readers working in realtime.
Just few problems to solve and some example scripts to develop but the biggest part seems done.
Eros
Michael Hartlef
02-07-2007, 19:25
That's good news, thanks Eros!
Glad to hear that Eros. You mentioned variants in that reply.
I tried using variants in a structure, but it would not work.
I was using it the setlightparameters a, b, c and d.
Depending on the parameter the variables can be a long, or double
Could you give an example of declaring variants.
I used
type tLight
... other type members...
a as variant
b as variant
c as variant
d as variant
end type
variant highlighted as a keyword, but when I ran the program it would give some error.
So when I changed from variant to long it stopped giving errors.
Thanks.
ErosOlmi
02-07-2007, 21:49
VARIANT are special beast. They have 16 bytes size each (LONG are 4 bytes). You cannot use VARIANT in places they are not supported. They are mainly used in COM (Components Objects Model) interfaces.
Maybe I still didn't add possibility to have VARIANT inside an UDT. I have to check.
I mentioned in previous post because till now it was not possibile to pass VARIANT parameters to external functions but now I was able and thanks to this I was able to port an XML wrapper developed by José Roca to thinBasic. Still alittle work to do but next version will have complete MSXML support. See MS documentation here: http://msdn2.microsoft.com/en-us/library/ms763742.aspx
It is quite a complex interface but I will clarify better with some examples I'm creating.
Ciao
Eros
Thanks Eros, glad it is going well for you and good luck with the examples, they always help!