Re: [xsl] Outputting literal and 'quoted' tags.

Subject: Re: [xsl] Outputting literal and 'quoted' tags.
From: Joerg Pietschmann <joerg.pietschmann@xxxxxx>
Date: Fri, 07 Dec 2001 13:45:16 +0100
Emiliano <emile@xxxxxxxxxxxxxx> wrote:
> Mike Brown wrote:
[about generating PHP tags with XSLT]
> True, but there are several spots where it gets lots more complex than
> this (constructing tables form the input, for example. But point well
> taken.

Well, letting XSLT generate stuff which is processed by yet another
processor usually leads to hacks.

The question is: Why do you actually have to set up such a pipeline?

If you have only reasonably few values which come from the environment
you can try to pass them as parameters to the style sheet and use
them there, thereby eliminating the need for post-processing.
If there is a lot of stuff which needs to be done by PHP (or ASP/...),
why not having the PHP page being the master, invoking the XSL
processor and embedding the results where possible and doing
everything else by itself? As an example, instead of writing a style
sheet like
  <xsl:stylesheet ...>
    <xsl:template match="/">
     <html><head>...
      <body>
        <!-- input form -->
        <form>...query form which needs postprocessing ...
        <!-- report generated from XML data -->
        <apply-templates mode="generate-report"/>
      </body>
  ...
use a foo.php
  <html><head>...
  <body>
    <!-- input form -->
    <form>....<?php echo($variable)?>...
    <!-- report generated from XML data -->
    <?php // invoke XSLT processor from PHP for formatting ?>
  </body>
 ...

Still other possibilities are using extension functions to pull
values from the environment into the stylesheet or, for Java
based processors, customized URI-resolvers
(http://www.biglist.com/lists/xsl-list/archives/200107/msg01261.html)

Regards
J.Pietschmann

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread