On Sat, Aug 14, 2004 at 11:48:18PM +0000, Martin Quinson wrote:
Modified Files:
Sgml.pm
Log Message:
attempt to fix the references, but I suspect nsgml to mess around with the
strings, like eating silencly 'unimportant' white chars
That's very strange. When I enable the debug, the references are correct,
ie, the line pointed by the reference of the generated file and the line
pointed by the reference of the original file do match. But then, the
reference which lands in the po file does not match.
It looks like a few '\n' are not seen by po4a. Indeed, it takes the
reference which it should have taken a few lines before. So, I guess that
nsgmls takes the liberty to remove some \n where they are not mandatory.
I have no idea.
I guess we should try to extract the reference recomputation and file
inclusion out of Sgml.pm to TransTractor, and see if the problem still
occure in Xml.pm, for example.
The prototype of the function in TT should be:
includefile($pre,$filename,$post);
so that "bliblu<include href="toto"/>blobla" can be dealt with
properly.
The action would be to open the file in a @variable, generate the
corresponding references ("refinmainfile:33 refinnewfile:44", first one=ref
at which we found the inclusion request, second naturally incrementing the
line number), and then unshiftline() all lines (begining with the last one)
of the @variable into the document.
The reference issue would also disappear since the stuff before the
inclusion is already eaten when includefile is called, and since we
unshiftline the stuff, we cannot mess with what comes afterward. We only
have to generate the right ref for the included file, which is trivial.
Bye, Mt.
--
If thy header files fail to declare the return types of thy library
functions, thou shalt declare them thyself with the most meticulous care,
lest grievous harm befall thy program.
-- Fourth commandment of the C programmer