|
From: Vitaly O. <vy...@vz...> - 2003-07-02 13:59:51
|
On Wed, 2 Jul 2003 21:10:18 +0800
James Devenish <j-d...@us...> wrote:
> Hi Vitaly,
>
> New ideas are welcome -- and it would be great for us to
> improve language support -- but each idea needs to be assessed
> for its practical value.
>
> In message <200...@vz...>
> on Wed, Jul 02, 2003 at 03:03:49PM +0400, Vitaly Ostanin wrote:
> > > I, too, would like to have had this. But DocBook XSL
> > > stylesheets, in general, are slow enough already. The
> > > problem with using a recursive template is that it can
> > > easily increase processing time by a factor of five.
> >
> > You right, modified style is slow, but XSLT is not for speed.
>
> It's not for slownees, either! :)
I optimize my version of template name="scape" (attached).
Now it used key() functionality from XSLT.
Top of my normalize-scape.mod.xsl:
<xsl:key name="entity" match="mapping" use="@key"/>
<xsl:variable name="latex.mapping.vyt"
select="document('latex.mapping.xml')"/>
Now speed statistic is (tested with xsltproc --timing --repeat):
original db2latex
Applying stylesheet 20 times took 15469 ms
vyt first (scape.xsl)
Applying stylesheet 20 times took 88864 ms
Saving result took 1 ms
vyt second (scape2.xsl)
Applying stylesheet 20 times took 34364 ms
> > > we will still use the long, monolithic "scape"
> > > template but it will be generated from a mapping file (not
> > > hand-coded).
> >
> > I'm not sure, that is the right way.
>
> >From what I have seen, it is the most practical way so far.
May be.
> > > > LaTeX doesn't support unicode characters by their
> > > > numbers, so each character need to be translated into
> > > > valid latex.
> > >
> > > I haven't found that to be possible (but I'm not an XSLT
> > > expert).
> >
> > It's easily doing with characters mapping, without any
> > extensions.
>
> I don't believe you! If you can find someone who has
> demonstrated that it is practical (or can explain how it could
> be done) that would help us find a new solution for DB2LaTeX.
I'll try :)
> As far as I can see, you're suggesting that we use
> substring(...) to iterate over every character in text() nodes
> and then do lookups in a 65000-element mapping document(most
> characters will require LaTeX packages to be loaded -- so there
> is always a need for a LaTeX-based solution). It simply isn't
> practical(time, space, software support) to do that.
You can split all mapping base by languages (numbers ranged) and
include only specified.
BTW, you can to have 2 alternative variants: with monolithic
"scape"; and with replaced from mapping base (separated from
latex.mapping.xml).
<skipped/>
--
Regards, Vyt
mailto: vy...@vz...
JID: vy...@vz...
|