skn3 Configdemo

Monkey Archive Forums/Monkey Discussion/skn3 Configdemo

Indiepath(Posted 2011) [#1]
Unfortunately this borks when using standards compliant XML.

config.monkey does not allow quoted attributes - it simply fails :(


The XML specification allows you to use either single or double quotes to indicate attributes, though the type of quote used must be the same on both sides of the attribute value. You must use quotes around attribute values, however. XML parsers will simply reject documents that do not use quotes around attribute values and report an error.



Will the author be fixing this?

Thanks.


Indiepath(Posted 2011) [#2]
Actually it appears to only support double quotes - I've change my copy to support single quotes also by adding the following code to each occurance of the double quote check
Or script[findIndex] = 39



Skn3(Posted 2011) [#3]
I will fix this, I have a few other tweaks as well that I havn't got round to finding time to email them over to mark.


Skn3(Posted 2011) [#4]
Here is the updated config module. Hopefully it will be in a future monkey release too (need to email Mark).

Updates are:
- added support for xml standard single and double quotes. Single quote must end with single and double with double
- added support for comments <!-- comment -->
- added destructor .Free() to clean up xml data (needs to be called manually)
- tweaked parser to remove some unnecessary steps




Indiepath(Posted 2011) [#5]
Nice!


xzess(Posted 2011) [#6]
This is really great, this should be added as module!
Thanks for sharing!