[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Outputting literal and 'quoted' tags.

Subject: Re: Outputting literal and 'quoted' tags.
From: Emiliano <emile@xxxxxxxxxxxxxx>
Date: Fri, 7 Dec 2001 14:24:41 +0100 (CET)
outputting xml tags in php
Joerg Pietschmann wrote:

> 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.

Agreed.

> 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

I don't. There's many of them, and they change during the runtime of the
program.

> 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

Because I don't think that actually makes my program a who lot more
simpler. There's loads of stuff that is static and can be taken somewhat
verbatim from the XML document. The non-static stuff is very much
interleaved; I can't see either the PHP code or the XML data being
'leading', and lots of knowledge about the structure of the XML document
needs to be in the PHP program itself. I tried actively pulling that
knowledge into my PHP program (using the domxml and xpath extensions)
but it was _way_ to slow and would routinely time out before doing
anything sensible. On top of that it would consume _loads_ of memory.
The preprocessing hack has brought both issues tremendously down. And it
has made the program readable.

> 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>
>  ...

The data I need to work on is in a database, and the metadata is in the
XML document. There's no single place I can (or rather, want) all my
data to be.

> 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)

I've thought about that, but the place of deployment has very limited
XML processing capabilities; all I have is PHP4 with a non-too-recent
Sablotron extension. xsl:number is not supported, for example, and I
need it.

As I understand it what I am doing is violating other peoples' sense of
aesthetics. I appreciate that, but I have limitations I can't readily
circumvent right now, and what I have so far is not just working, but
working wonderfully well from my perspective.

Emile



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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.