Hi, <[EMAIL PROTECTED]> writes:
> On Tue, Apr 22, 2008 at 02:34:26PM +0200, Carl Fredrik Hammar wrote: > >> One possibility would be to simply prefix the non-attribute nodes with >> numbers, e.g. `1 author', `2 title', `3 isbn'. The problem here >> is with insertion, because it would require renaming the following >> nodes prior to this. >> >> One way of tackling this would be to have a specifiable spacing >> between the numbers, e.g. `10 author', `20 title', `30 isbn'. The >> space will run out, but a command for re-spacing the existing nodes >> would be fix this. > > I don't like the fixed spacing bit, but the idea is interesting, and > made me think of something sligtly different: How about fractions? 2.1, > 2.2, 2.1.1... Wow, that even gets properly sorted by ls. At least with ASCII's collation, but it doesn't seem to work under unicode, which is unfortunate. Also, I can't help to think it will get annoying after three levels or so. Wouldn't it be easier to just up the spacing to, say 1000? > These would be robust as long as the translator stays active. It would > still change when restarting the translator though, which is problematic > IMHO. I don't see how the filenames can be persistent, without storing them in a auxiliary file or worse, in a comment. I think we have to accept that they will change. The question is when, before by renaming to make room for an insertion, between restarts, or both. But I can't come up with a good use-case for this, are you sure it's a problem? I don't think anybody actually wants to pretend an XML file is anything like a real filesystem. Something has got to give, and this seems like a better candidate then easy insertions, moves and deletions. Regards, Fredrik