Re: exports (was: source encoding)
Brought to you by:
bs_php,
nigelswinson
From: Nigel S. <nig...@us...> - 2002-06-14 21:38:08
|
> if I pass in NULL, it uses the default, which in this case I don't > want. IMO > 1. exportAsXml and exportToFile should do the same > 2. if there is an input file (i.e. this is a change, not a create > new), then use header from input file unless override param > 3. if not (i.e. this is a new file), use a default <?xml ...> header > unless override param Ok have updated all this. Now the class will use the following preference order in the _export() function, that is called by both exportToFile() and exportAsXml(). 1) The xmlHeader you supply as an argument 2) The xmlHeader that it parsed at import time 3) A default of <?xml version="1.0"?> I presume this is what we want? If not please get in touch. > Whilst testing this, I came across another, um, feature. If you have 2 > exports one after the other, for example > ... > print $xml->exportAsXml(); > print $xml->exportAsXml(); > ... > the first one will have the header, the second and subsequent will > not. I take it this is a bug and not intentional? Seems to have > something to do with the node index, though putting reindexNodeTree() > between the 2 exports had no effect. I forgot to try to reproduce this before I made the fix, and now can't reproduce it, so I presume that I fixed it on the way. If not then I'm sure we'll find out some time... Cheers, Nigel |