r15486 - gnucash/trunk/src - SX "enabled" patch from Peter McAlpine <peter at aoeu.ca>.

Peter McAlpine peter at aoeu.ca
Thu Feb 1 22:24:56 EST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Just to throw out some ideas:

In this case would it be possible to partially avoid the issue by not  
outputting the enabled tag if the SX is enabled (because it defaults  
to true)?

Would this be a quicker solution than fully implementing KVPs:
Whenever unrecognized tags are found just read the tag into some  
buffer and when the the object is to be outputted then output the tag  
just as it was read in.

Increment the xml version whenever there's new tags added that are  
completely incompatible. Refuse to load newer versions.

- - -Peter

On 1-Feb-07, at 10:55 AM, Josh Sled wrote:

> On Thu, 2007-02-01 at 09:50 -0500, Derek Atkins wrote:
>> Why not store the sx:enabled flag in the SX instance KVP?  Granted, I
>> dont think 2.0 has an SX KVP, but we could maybe fix that...
>
> Besides the fact -- as you point out -- that it doesn't solve the
> problem, KVP frames aren't actually data model.  I maintain that we
> should try not to use them, and if we do, only with good reason; this
> doesn't feel like one.
>
>
>> I'll
>> point out that the 2.0 parser will barf on unknown tags and fail
>> to load the data file.
>
> Yup; as I mentioned on -devel, it might be a good thing to fix for a
> 2.0.{5,6}, so we get a bit of breathing room for 2.{x>0}...
>
> To preempt your question about "how do you tell a broken datafile from
> one with simply new tags?", I say: "you don't".  You let XML
> well-formed-ness deal with really corrupted datafiles, and you ignore
> any tags or attributes that you don't recognize.   If you then ignore
> valid future data, fine; if you ignore invalid/broken data, fine.  The
> utility of reading a wider set of datafiles is higher than the risk of
> reading inconsistent data, with some amount of care taken in the  
> future.
>
> -- 
> ...jsled
> http://asynchronous.org/ - a=jsled;b=asynchronous.org;echo ${a}@${b}
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel

- -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFFwq2DeeKWVnwTIPIRAuVmAJ436DdXImQYqizn6GPUHJSXDbFMYACfR+jc
z+p9sH2Z3RzYfpPhqqQ4Y/Y=
=z5Bb
- -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFFwq8JeeKWVnwTIPIRAof4AKCFDRWiT6Dd9PH03fELFSodHevPdACeNFgU
RUCeWEHXZXF0HoAXEgsWEU0=
=Bvj4
-----END PGP SIGNATURE-----


More information about the gnucash-devel mailing list