[TYPO3-bugs] Please review issue 0004351
Oliver Klee
typo3-german-01 at oliverklee.de
Tue Oct 10 09:43:02 CEST 2006
Hi,
maybe we are talking about two different things here which need to be
dealt with separately:
1. How XML is stored in internally and in the DB.
2. How XML is stored in files.
In my case, I started with 2. as this was an itch of mine about how
ll_xml saves its language files. As ll_xml uses t3lib_div::xml2array()
for creating the XML, one possible way to change the created files was
to change that function (hoping that this might be beneficial for other
functions that create XML files9.
If we find that the function should not be changed, then I would create
a patch for the ll_xml extension.
Dmitry Dulepov schrieb:
> Martin Kutschker wrote:
>> What is good now, an extra LF or no? I am against any extra LF around
>> (before and after) the outermost XML element or the PHP processing
>> instruction.
>
> To me perfect solution would be:
> - no ending LF in XML by default (as it is now)
> - new flag to t3lib_div::xml2array() to skip spacing/indentation at all.
> This way huge templavoila structures could save some space
Concerning files, a *missing* LF at the end creates a warning "no
newline at end of file" in CVS (I'm not sure about SVN, though). At
least the Mozilla project (as seen from review comments in their bug
tracker), Cocoon and Drupal have a LF at the end of each plain text file
as part of their coding style:
http://cocoon.apache.org/community/committer.html
http://drupal.org/node/86675
For files, the LF after XML tags should be retained as otherwise
patches/diffs are not really manageable any more.
For stuff in the DB that does not need to be human-readable (or
human-editable), saving space sure is a good thing IMHO.
So, to come to a conclusion:
1. Do we have agreement (or at least no objections) that *for*files* a
LF at the end is A Good Thing (TM)?
2. Should the adding of the final LF happen in
t3lib_div::xml2array() or in the ll_xml extension?
3. Is anyone's itch big enough to write a patch to
t3lib_div::xml2array() that allows skipping all unnecessary whitespace
(which should be off by default as not to break old ll_xml versions)?
Regards,
Oliver
More information about the TYPO3-team-bugs
mailing list