Some XML Funniness...

Christopher Browne cbbrowne@acm.org
Fri, 14 Dec 2001 15:18:36 -0500


Apparently the XML parser is quite dependent on the positions of elements 
matching with some sort of implicit ordering.

I was planning to en-masse move a bunch of accounts into a hierarchy; I've got 
a bunch of $USD accounts that I'm not using much anymore, and figured I'd hide 
them under "US Expenses."

The UI for that is not terribly convenient; I get to look at the list of 
accounts roughly one by one, and have no way to say "Select all the accounts; 
make [BLAH] the parent."

So I figure I'll just go in using vi, and grab the relevant gnc:parent link, 
and populate it in everywhere.

Strangely, it gets ignored a lot.  If I don't have the "US Expenses" defined 
already, the children have a problem with the "forward reference."  And it 
looks like if I don't put it in as about the last element in the entry, it 
gets ignored.  (Though that may be an artifact of the other factor; haven't 
checked...)

At any rate, the strong "positionalness" of this seems somewhat a matter for 
concern.  Clearly people should NOT run their GnuCash files through any 
filters that would canonicalize them, as this might mess up the order, and 
thus mess up your data...
--
(reverse (concatenate 'string "gro.gultn@" "enworbbc"))
http://www3.sympatico.ca/cbbrowne/lisp.html
Chad has brought us a brilliant new twist: "Nobody has ever been a bad
parent by buying Microsoft." 
-- David Steinberg <steinber@interchange.ubc.ca>