3 ms·
For some new work, I originally fought against using XML for storing data. Good ol' "key = value" would have done the trick, mostly, although as we kept adding
by etal 18y ago
For some new work, I originally fought against using XML for storing data. Good ol' "key = value" would have done the trick, mostly, although as we kept adding data it might have been handy to impose more structure on it. Nonetheless, it was explained to me that the customer would have to be able to deal with these files, and we absolutely could not rely on them to touch the files with Notepad without screwing things up (CRLF vs LF, accidentally scrambling key names, etc.). What we can rely on, though, is XML:
1. Whipping up a web interface for editing the values in the files is trivial
2. If the customer or a less computer-savvy rep needs to tweak the files manually, we can tell them to use XML Notepad to minimize the risk of clobbering something.
I found that by using one layer of nodes and putting the data in attributes instead of their own nodes, the structure is roughly equivalent to INI or Apache config files, and not much more verbose. Maybe it's the Python in my blood speaking, but I appreciate having one obvious solution to a recurring, mundane problem -- organizing and storing small amounts of simple data in a way that anyone can retrieve it.
- xirium 18y ago> use XML Notepad If the format gets unwieldly that you require special software then the benefit of it being a human-readable text format is lost.
- etal 18y agoAgreed, but in this case the readability of the text format is only a minor benefit. I didn't want to go on a tangent, but the problem is that vanilla Windows XP (not sure about Vista) does not make it safe to play with plain text files, especially those meant for a Linux system. Notepad is not safe. So to protect the unaware, we need another layer between the user and the raw data to make . Any format would be fine, as long as there's a free tool available that the customer and their paranoid IT support would both be comfortable with, which preferably might already be installed, and Windows knows not to open it with Notepad by default. Since other products on the same network already use XML, the customer is OK with staring at this format, expects that .xml files will pop up read-only in Internet Explorer, and knows that the angled brackets mean serious business. If any other format met all these needs at once, I'd jump for it -- but I haven't seen anything else that does. Any suggestions for other formats that work well on both Windows and Unix?