[pdftex] PassiveTeX

Giuseppe Greco giuseppe.greco at agamura.com
Sat Mar 15 12:45:17 CET 2003


> Hi Giuseppe,

Hi Rolf,

> 
> in my case, the FO processor would have to produce an XSL stylesheet,
> something like
> 
>    \begin{tabular}[t]{p{4cm}p{5.5cm}p{5.5cm}}%
>      <xsl:for-each select="Customers/Customer">
>        <xsl:choose>
>          <xsl:when test="@VIP">
>            \emph{<xsl:value-of select="LastName"/>} &amp;%
>          </xsl:when>
>          <xsl:otherwise>
>            <xsl:value-of select="LastName"/> &amp;%
>          </xsl:otherwise>
>        </xsl:choose>
>        <xsl:value-of select="MiddleInitial"/> &amp;%
>        <xsl:value-of select="FirstName"/> \\%
>      </xsl:for-each>
>    \end{tabular}
>    Total VIPs: <xsl:value-of select="count(Customers/Customer[@VIP])"/>
> 
> not only a .tex file like
> 
>    \begin{tabular}[t]{p{4cm}p{5.5cm}p{5.5cm}}%
>      Smith & & Granny\\
>      \emph{Ewing} & R. & J.\\
>    \end{tabular}
>    Total VIPs: 1
> 
> because there are still substitutions which have to be done during runtime.
> So do all my xsl-statements in the .fo file have to be escaped in some way or
> is it possible that the FO processor doesn't touch the xsl namespace at all?
> 

Is it really necessary to process the document in two different phases?
Wouldn't be possible to process everything at the end? Eventually,
would it make sense to create two stylesheets, one be used to process
the original XML document, and another one to be used during runtime
transformations? You can also user XSLT for transforming XML to XML...

In any case, I don't have so much experience on that area...

> Concerning the TeX parser, performance wouldn't be that important in my case
> because the FO processing isn't done during runtime. But I ask myself if a
> FO processor which produces TeX code has to (should) heavily rely on xmltex.
> Sure, thus it's neatly integrated within the TDS structure. On the other hand,
> you don't have the flexibility in using the XML parser of your choice and
> you have to have a TeX system installed on every machine on which you do the FO
> processing.

That's right, but I think TeX/LaTeX is the best choice for generating
PS/PDF.

I personally generate HTML directly via xsltproc, but relay on the TeX
system when I need to perform FO->PDF transformations.

Have you ever tried tex4ht? It allows you to create HTML/XML/DocBook
documents from DVI files...

You can download it as zip file at 
http://www.cis.ohio-state.edu/~gurari/tex4ht

If you are using an RPM-based Linux system, you can download it from
our ftp server at ftp.agamura.com/pub.

> 
> I have no idea, it's all still brainstorming, but I wonder if it wouldn't be
> possible to implement the FO processing as a pure XSL transformation (with
> an XSL stylesheet, like it can be done with producing HTML code).

Do you mean XML->FO->PDF?

> Of course,
> in this case you would need an XSL processor but this isn't a big restriction
> these days (in the case of distributing it within TeXLive, it would typically
> be under the bin directory). Or a FO processor based on SAX or expat could
> be possible.
> On IBM alphaworks there is TeXML which consists of a DTD and a Java program
> which produces TeX code from an XML document which conforms to this DTD. At
> first glance, it seemed unnecessary to me to use another document style. But
> for my workflow it could make sense to use it (or to develop another?) instead
> of complex XSL-FO. I should look at this DTD more precisely. Of course,
> TeXML shouldn't resemble the TeX grammar too much (because what would be the
> benefit of TeX just expressed in similar XML terms?), and the TeXML documents
> should be relatively easy to produce (eg. from .fo?). Or should the TeXML-DTD be
> the leading format like DocBook --> XSL-FO --> ...?

I know the existence of TeXML, but I've never tried it. I don't like
Java stuff so much, so I've opted for PassiveTeX...

> 
> So probably I have to do a lot more research. I guess there isn't a straight
> solution yet. But it starts getting off-topic on this ML. The only excusion
> I have is that at the end of all I want to produce PDF with pdfTeX -;
> 

Talk to you soon,
Gius_.

> Ciao,
> Rolf
-- 
----------------------------------------
Giuseppe Greco

::agamura::

phone:  +41 (0)91 604 67 65
mobile: +41 (0)76 390 60 32
email:  giuseppe.greco at agamura.com
web:    www.agamura.com
----------------------------------------



More information about the pdftex mailing list