[Po4a-devel]File inclusion belongs to TransTractor directly

Martin Quinson martin.quinson@loria.fr
Tue, 24 May 2005 14:02:54 +0200


--3xQkynibq3FKlJyM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, May 21, 2005 at 06:13:56PM +0200, Jordi Vilalta wrote:
> Hi,
>=20
> On Thu, 19 May 2005, Francois Gouget wrote:
> >Wine's DobBook documentation is in SGML but I also tried the DocBook.pm=
=20
> >module on it. The nice thing is that it translates the 'lang' attribute.=
=20
> >The bad thing is that it does not handle including files using entities=
=20
> >and this is extensively used in Wine's documentation :-(.
>=20
> One solution would be to use configuration files (see po4a(1)) to=20
> translate the files separated, and obtain a hierarchy like the original=
=20
> document's one.
>=20
> If it's very annoying (if there are lots of files to insert into the=20
> config file...) I'll try to implement the file inclusion this summer. (I'=
m=20
> out of time currently)

File inclusion should be easy to implement outside the Sgml.pm module.
That's indeed a shame that this is implemented in the module where it's the
more complicated (using an external parser requires a load of bookkeeping to
indicate the right position on error messages) and not in the others.

I guess that we just need a include_file(filename) function in TransTractor=
=2Epm
Its action would be much like the read() function already there. You only
need to read into a new array instead of @{$self->{TT}{doc_in}} Then, when
you got all the file,=20
while (defined(my ($l,$ref) =3D pop @newarray) {
  $self->unshiftline($l,$ref);
}

or so. Ie, insert the content of the new file in the working spaces. I'll do
the trick for all modules using the popline function. Ie, Man.pm and Xml.pm
(for now. One day, Sgml.pm will be in this list).



I hope it makes sense to someone with more free time than me ;) If you want
to proceed and implement this, please go ahead.=20

Bye, Mt.

--3xQkynibq3FKlJyM
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFCkxfuIiC/MeFF8zQRAvc+AKC0i1D1TYRl8HGL+90c+6dDBOeicQCdEdSu
//x2PCCbeX1n+1gsnWZKQTg=
=2Opj
-----END PGP SIGNATURE-----

--3xQkynibq3FKlJyM--