You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by Ferdinand Soethe <fe...@apache.org> on 2005/11/28 16:38:13 UTC
Quick way to skin php-files?
I'm looking for a simple way og integrating documents with php-function
calls (that generate content) into a Forrest Website. To be precise,
I want to place an html-document with something like <?....> within
its body into my Forrest and generate a skinned document with the
ending .php (and the unchanged <?....> within its body) so that I can
place this on a php-enabled server and use external scripts.
Note: I'm not expecting the php-function calls to be resolved by
Forrest, I merely want the document skinned and php-calls passed
intact.
Any suggestions?
--
Ferdinand Soethe
Re: Quick way to skin php-files?
Posted by Ferdinand Soethe <fe...@apache.org>.
Cyriaque Dupoirieux wrote:
> I have a plugin for this, are you interested I send it to you in a
> private way ?
Sure thanks, I might actually be able to learn something from the way you did
it. Please use my private mail 1@soethe.net.
The interesting part would really be the pipeline as the
php-instructions pass untouched through my html-pipeline. I just don't
manage to get them skinned. And didn't want to re-create the whole
html-pipeline in my custom sitemap.
--
Ferdinand Soethe
Re: Quick way to skin php-files?
Posted by Moshe Yudkowsky <ms...@bl.com>.
Cyriaque Dupoirieux a écrit:
> I have a plugin for this, are you interested I send it to you in a
> private way ?
> It works like this : You insert your php calls between <php> and
> </php> tags in a xml source which accepts all our dtd (sections, title,
> note, warning...)
> The generated file is a corresponding skinned php file with the <?php
> and ?> marks.
> (It is not finished, for instance, I haven't created the dtd...)
I would also like a copy of this -- but does it work without the DTD? Or
do you turn off checking?
Regards,
Moshe
Re: Quick way to skin php-files?
Posted by Cyriaque Dupoirieux <Cy...@pcotech.fr>.
Ferdinand Soethe a écrit :
>I'm looking for a simple way og integrating documents with php-function
>calls (that generate content) into a Forrest Website. To be precise,
>
>I want to place an html-document with something like <?....> within
>its body into my Forrest and generate a skinned document with the
>ending .php (and the unchanged <?....> within its body) so that I can
>place this on a php-enabled server and use external scripts.
>
>Note: I'm not expecting the php-function calls to be resolved by
>Forrest, I merely want the document skinned and php-calls passed
>intact.
>
>Any suggestions?
>
>
Hi Ferdinand,
I have a plugin for this, are you interested I send it to you in a
private way ?
It works like this : You insert your php calls between <php> and
</php> tags in a xml source which accepts all our dtd (sections, title,
note, warning...)
The generated file is a corresponding skinned php file with the
<?php and ?> marks.
(It is not finished, for instance, I haven't created the dtd...)
Salutations,
Cyriaque,
>--
>Ferdinand Soethe
>
>
>
>
Re: Quick way to skin php-files?
Posted by Ross Gardler <rg...@apache.org>.
Ferdinand Soethe wrote:
> Ross Gardler wrote:
>
>
>>Try requesting "body-abc.html". What do you get?
>
>
> I'm getting
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
> <tocitems></tocitems><meta-data>
> <meta content="HTML Tidy, see www.w3.org" name="generator">
> </meta-data><div id="content">
> <div id="skinconf-printlink"></div>
> <div id="skinconf-xmllink"></div>
> <div id="skinconf-podlink"></div>
> <div id="skinconf-txtlink"></div>
> <div id="skinconf-pdflink"></div>
> <div id="disable-font-script"></div>
> <div id="skinconf-toc-page"></div>
> </div>
Well there's no content in there, so your original HTML file is not
being correctly processed. Probably a problem with document-to-html.xsl
>>>However trying that menu-item I only received this rather unspecific
>>>error message:
>>>
>>>Message: null
>>>Description: No details available.
>>>Sender: org.apache.cocoon.servlet.CocoonServlet
>>>Source: Cocoon Servlet
>>>Request URI
>>>anmeldungPHP.php
>>>cause
>>>null
>>>request-uri
>>>/anmeldungPHP.php
>>>
>>>Any ideas?
>
>
>>What is anmeldunPHP.php? It appears to have nothing to do with your
>>request for "abc.php", however, Cocoon is requesting it, any idea why?
>
>
> I'm, sorry. In my mail I changed the original name of the files
> from 'anmeldungPHP' to 'abc' to not confuse anybody.
OK, then I guess the problem is that described above. But you may find
more info in the logs.
(incidentally, as a native English speaker that filename looks
suspiciously like Animal Dung - rather an unfortunate "translation" ;-)
Ross
Re: Quick way to skin php-files?
Posted by Ferdinand Soethe <fe...@apache.org>.
Ross Gardler wrote:
> Try requesting "body-abc.html". What do you get?
I'm getting
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<tocitems></tocitems><meta-data>
<meta content="HTML Tidy, see www.w3.org" name="generator">
</meta-data><div id="content">
<div id="skinconf-printlink"></div>
<div id="skinconf-xmllink"></div>
<div id="skinconf-podlink"></div>
<div id="skinconf-txtlink"></div>
<div id="skinconf-pdflink"></div>
<div id="disable-font-script"></div>
<div id="skinconf-toc-page"></div>
</div>
>> However trying that menu-item I only received this rather unspecific
>> error message:
>>
>> Message: null
>> Description: No details available.
>> Sender: org.apache.cocoon.servlet.CocoonServlet
>> Source: Cocoon Servlet
>> Request URI
>> anmeldungPHP.php
>> cause
>> null
>> request-uri
>> /anmeldungPHP.php
>>
>> Any ideas?
> What is anmeldunPHP.php? It appears to have nothing to do with your
> request for "abc.php", however, Cocoon is requesting it, any idea why?
I'm, sorry. In my mail I changed the original name of the files
from 'anmeldungPHP' to 'abc' to not confuse anybody.
So I was really requesting
'anmeldungPHP.php' in site and the file in xdocs is named 'anmeldungPHP.html'.
This the name in the error message.
--
Ferdinand Soethe
Re: Quick way to skin php-files?
Posted by Ross Gardler <rg...@apache.org>.
Ferdinand Soethe wrote:
>>This is untested, but would be where I would start experimenting and I'm
>>pretty sure is close to correct (maybe even correct ;-).
>
>
> Thanks Ross, that was exactly what I was looking for. I just didn't
> know where to intercept. Will give it a try right away ...
>
>
> OK. I put this
>
> <!-- php Pilelines -->
> <!--pipeline that "marries" the docs in the root dir with the skin to produce html-->
> <map:match pattern="*.php">
> <map:aggregate element="site">
> <map:part src="cocoon:/skinconf.xml"/>
> <map:part src="cocoon:/build-info"/>
> <map:part src="cocoon:/tab-{1}.html"/>
> <map:part src="cocoon:/menu-{1}.html"/>
> <map:part src="cocoon:/body-{1}.html"/>
> </map:aggregate>
>
> <map:call resource="skinit">
> <map:parameter name="type" value="site2xhtml"/>
> <map:parameter name="path" value="{1}.html"/>
> </map:call>
> </map:match>
> <!--pipeline that "marries" the docs in all other dirs then root with the skin to produce html-->
> <map:match pattern="**/*.php">
> <map:aggregate element="site">
> <map:part src="cocoon:/skinconf.xml"/>
> <map:part src="cocoon:/build-info"/>
> <map:part src="cocoon:/{1}/tab-{2}.html"/>
> <map:part src="cocoon:/{1}/menu-{2}.html"/>
> <map:part src="cocoon:/{1}/body-{2}.html"/>
> </map:aggregate>
> <map:call resource="skinit">
> <map:parameter name="type" value="site2xhtml"/>
> <map:parameter name="path" value="{1}.html"/>
> </map:call>
> </map:match>
>
> into my custom sitemap and copied the skinit-ressource into it as well
> (because Forrest complained).
>
> Then I entered a href of
>
> abc.php
>
> into my sitemap and placed the html-document
> abc.html into xdocs.
Try requesting "body-abc.html". What do you get?
> However trying that menu-item I only received this rather unspecific
> error message:
>
> Message: null
> Description: No details available.
> Sender: org.apache.cocoon.servlet.CocoonServlet
> Source: Cocoon Servlet
> Request URI
> anmeldungPHP.php
> cause
> null
> request-uri
> /anmeldungPHP.php
>
> Any ideas?
What is anmeldunPHP.php? It appears to have nothing to do with your
request for "abc.php", however, Cocoon is requesting it, any idea why?
Ross
Re: Whiteboard usage - rename it to incubator
Posted by David Crossley <cr...@apache.org>.
David Crossley wrote:
>
> So lets be absolutely sure that this is what we want to
> do first. Need to find the last discussion. I am sure that
> we talked about the wider topic and there were agreements on
> various aspects of how to do our development. Changing the
> name was probably just one component of that.
>
> Our trouble is that we don't document this stuff in the project
> Guidelines doc (even links to discussion would be a start).
I made a start and collected some of the threads:
http://forrest.apache.org/guidelines.html#develop
-David
Re: Whiteboard usage - rename it to incubator
Posted by David Crossley <cr...@apache.org>.
Thorsten Scherler wrote:
> David Crossley escribi??:
> > Thorsten Scherler wrote:
> > > Ross Gardler escribi??:
> > > > By definition whiteboard stuff is not supported by the Forrest
> > > > community, so people use it at their own risk. If something in
> > > > whiteboard gets enough community support then it will migrate into
> > > > trunk. That move would be where we take a vote.
> > >
> > > The migration is not only community but as well code related.
> > >
> > > IMO we really should consider renaming whiteboard to incubator, because
> > > it is the place to develop not only new code but as well a community
> > > around it. Should I call a vote?
> > >
> > > WDYT?
> >
> > Just discussing the proposal will be sufficient.
> >
> > Why does it need a name change?
>
> Because the name is not reflecting what is does. A whiteboard means in
> my dictionary something completely different then the function of the
> whiteboard in forrest. IMO the name is *too* misleading to keep it. Like
> I wrote some time ago, e.g. in the incubator the whiteboard is a link to
> the wiki (which makes sense).
The "whiteboard" has changed over time. It was intended
as a place to just experiment. However we have started
doing development there rather than using branches.
So we have changed the nature of the whiteboard.
> > We could just add
> > to the Guidelines document to explain what we mean
> > by "whiteboard" and what are the conditions for
> > moving stuff into trunk.
>
> Hmm, we should do this anyway, even if we change the name. My point is
> that the name is not appropriate for reflecting the usages.
Also, the job cannot be taken lightly. There is a stack
of configuration files, build files, plugin deployment process,
and documentation to change.
So lets be absolutely sure that this is what we want to
do first. Need to find the last discussion. I am sure that
we talked about the wider topic and there were agreements on
various aspects of how to do our development. Changing the
name was probably just one component of that.
Our trouble is that we don't document this stuff in the project
Guidelines doc (even links to discussion would be a start).
-David
Re: Whiteboard usage - rename it to incubator
Posted by Thorsten Scherler <th...@apache.org>.
El vie, 02-12-2005 a las 08:22 +1100, David Crossley escribió:
> Thorsten Scherler wrote:
> > Ross Gardler escribi??:
> > > By definition whiteboard stuff is not supported by the Forrest
> > > community, so people use it at their own risk. If something in
> > > whiteboard gets enough community support then it will migrate into
> > > trunk. That move would be where we take a vote.
> >
> > The migration is not only community but as well code related.
> >
> > IMO we really should consider renaming whiteboard to incubator, because
> > it is the place to develop not only new code but as well a community
> > around it. Should I call a vote?
> >
> > WDYT?
>
> Just discussing the proposal will be sufficient.
>
> Why does it need a name change?
Because the name is not reflecting what is does. A whiteboard means in
my dictionary something completely different then the function of the
whiteboard in forrest. IMO the name is *too* misleading to keep it. Like
I wrote some time ago, e.g. in the incubator the whiteboard is a link to
the wiki (which makes sense).
> We could just add
> to the Guidelines document to explain what we mean
> by "whiteboard" and what are the conditions for
> moving stuff into trunk.
Hmm, we should do this anyway, even if we change the name. My point is
that the name is not appropriate for reflecting the usages.
>
> -David
salu2
--
thorsten
"Together we stand, divided we fall!"
Hey you (Pink Floyd)
Re: Whiteboard usage - rename it to incubator
Posted by David Crossley <cr...@apache.org>.
Thorsten Scherler wrote:
> Ross Gardler escribi??:
> > By definition whiteboard stuff is not supported by the Forrest
> > community, so people use it at their own risk. If something in
> > whiteboard gets enough community support then it will migrate into
> > trunk. That move would be where we take a vote.
>
> The migration is not only community but as well code related.
>
> IMO we really should consider renaming whiteboard to incubator, because
> it is the place to develop not only new code but as well a community
> around it. Should I call a vote?
>
> WDYT?
Just discussing the proposal will be sufficient.
Why does it need a name change? We could just add
to the Guidelines document to explain what we mean
by "whiteboard" and what are the conditions for
moving stuff into trunk.
-David
Whiteboard usage - rename it to incubator
Posted by Thorsten Scherler <th...@apache.org>.
El jue, 01-12-2005 a las 12:13 +0000, Ross Gardler escribió:
> By definition whiteboard stuff is not supported by the Forrest
> community, so people use it at their own risk. If something in
> whiteboard gets enough community support then it will migrate into
> trunk. That move would be where we take a vote.
The migration is not only community but as well code related.
IMO we really should consider renaming whiteboard to incubator, because
it is the place to develop not only new code but as well a community
around it. Should I call a vote?
WDYT?
salu2
--
thorsten
"Together we stand, divided we fall!"
Hey you (Pink Floyd)
Re: PHP plugin (was Re: Quick way to skin php-files?)
Posted by Ross Gardler <rg...@apache.org>.
Cyriaque Dupoirieux wrote:
> Thorsten Scherler a écrit :
>
>> El jue, 01-12-2005 a las 11:02 +0100, Cyriaque Dupoirieux escribió:
>> ...
>>
>>
>>>>>> Hi,
>>>>>>
>>>>>> I made this in my php pipeline :
>>>>>> <map:pipeline>
>>>>>>
>>>>>> <!-- PHP Documentation -->
>>>>>> <map:match type="regexp" pattern="^(.*?)([^/]*).php$">
>>>>>> <map:generate src="cocoon://{1}{2}.html"/>
>>>>>> <map:transform src="resources/stylesheets/php/document2php.xsl"/>
>>>>>> <map:serialize type="html"/>
>>>>>> </map:match>
>>>>>>
>>>>>
>>>>>
>>>>> What does document2php.xsl do? Is this appraoch better for
>>>>> Ferdinand than the one I suggest?
>>>>>
>>>
>>> It just transform the <php> and </php> tags into *<?php* and *?>*...
>>> In fact, I have created an output plugin for php format.
>>> This plugin match php extension file in order to generate the skinned
>>> HTML and clean the <php> and </php> tags between which I put php calls.
>>>
>>> On the paper it was simple, my problem is the horible performance I
>>> get to generate the skinned HTML.
>>> With the Cocoon Profile I get :
>>> 1 file /src=/cocoon://livres/livres.html 3031 3031 3031
>>> 2 xslt /src=/resources/stylesheets/php/document2php.xsl
>>> 46 46 46
>>>
>>> to get a php file whereas it takes arround 100 to get a "normal"
>>> skinned HTML page...
>>>
>>>
>>
>>
>> Can you check this in the whiteboard area, please (if you want).
>>
>> It seems to be from wider interest to our community and it would be nice
>> to have it in our code base.
>> WDOT?
>>
>>
> Thank you, Thorsten, for your interest, I needed it to connect to my
> MySql DB and to generate tables from specific queries...
> I am waiting for the others answer and I will commit in whiteboard if
> the vote is OK.
No need for a vote for whiteboard content, just chuck it in there.
By definition whiteboard stuff is not supported by the Forrest
community, so people use it at their own risk. If something in
whiteboard gets enough community support then it will migrate into
trunk. That move would be where we take a vote.
Ross
Re: PHP plugin (was Re: Quick way to skin php-files?)
Posted by Cyriaque Dupoirieux <Cy...@pcotech.fr>.
Thorsten Scherler a écrit :
>El jue, 01-12-2005 a las 11:02 +0100, Cyriaque Dupoirieux escribió:
>...
>
>
>>>>>Hi,
>>>>>
>>>>> I made this in my php pipeline :
>>>>> <map:pipeline>
>>>>>
>>>>> <!-- PHP Documentation -->
>>>>> <map:match type="regexp" pattern="^(.*?)([^/]*).php$">
>>>>> <map:generate src="cocoon://{1}{2}.html"/>
>>>>> <map:transform src="resources/stylesheets/php/document2php.xsl"/>
>>>>> <map:serialize type="html"/>
>>>>> </map:match>
>>>>>
>>>>>
>>>>
>>>>What does document2php.xsl do? Is this appraoch better for Ferdinand
>>>>than the one I suggest?
>>>>
>>>>
>>It just transform the <php> and </php> tags into *<?php* and *?>*...
>>In fact, I have created an output plugin for php format.
>>This plugin match php extension file in order to generate the skinned
>>HTML and clean the <php> and </php> tags between which I put php calls.
>>
>>On the paper it was simple, my problem is the horible performance I get
>>to generate the skinned HTML.
>>With the Cocoon Profile I get :
>>1 file /src=/cocoon://livres/livres.html 3031 3031 3031
>>2 xslt /src=/resources/stylesheets/php/document2php.xsl 46
>>46 46
>>
>>to get a php file whereas it takes arround 100 to get a "normal" skinned
>>HTML page...
>>
>>
>>
>
>Can you check this in the whiteboard area, please (if you want).
>
>It seems to be from wider interest to our community and it would be nice
>to have it in our code base.
>
>WDOT?
>
>
Thank you, Thorsten, for your interest, I needed it to connect to my
MySql DB and to generate tables from specific queries...
I am waiting for the others answer and I will commit in whiteboard if
the vote is OK.
Salutations,
Cyriaque,
>salu2
>
>
PHP plugin (was Re: Quick way to skin php-files?)
Posted by Thorsten Scherler <th...@apache.org>.
El jue, 01-12-2005 a las 11:02 +0100, Cyriaque Dupoirieux escribió:
...
> >>>>
> >>> Hi,
> >>>
> >>> I made this in my php pipeline :
> >>> <map:pipeline>
> >>>
> >>> <!-- PHP Documentation -->
> >>> <map:match type="regexp" pattern="^(.*?)([^/]*).php$">
> >>> <map:generate src="cocoon://{1}{2}.html"/>
> >>> <map:transform src="resources/stylesheets/php/document2php.xsl"/>
> >>> <map:serialize type="html"/>
> >>> </map:match>
> >>
> >>
> >>
> >> What does document2php.xsl do? Is this appraoch better for Ferdinand
> >> than the one I suggest?
> >
> It just transform the <php> and </php> tags into *<?php* and *?>*...
> In fact, I have created an output plugin for php format.
> This plugin match php extension file in order to generate the skinned
> HTML and clean the <php> and </php> tags between which I put php calls.
>
> On the paper it was simple, my problem is the horible performance I get
> to generate the skinned HTML.
> With the Cocoon Profile I get :
> 1 file /src=/cocoon://livres/livres.html 3031 3031 3031
> 2 xslt /src=/resources/stylesheets/php/document2php.xsl 46
> 46 46
>
> to get a php file whereas it takes arround 100 to get a "normal" skinned
> HTML page...
>
Can you check this in the whiteboard area, please (if you want).
It seems to be from wider interest to our community and it would be nice
to have it in our code base.
WDOT?
salu2
--
thorsten
"Together we stand, divided we fall!"
Hey you (Pink Floyd)
Re: Quick way to skin php-files?
Posted by David Crossley <cr...@apache.org>.
Cyriaque Dupoirieux wrote:
> Ross Gardler a ?crit :
> >Cyriaque Dupoirieux wrote:
> >>
> >>On the paper it was simple, my problem is the horible performance I
> >>get to generate the skinned HTML.
> >>With the Cocoon Profile I get :
> >>1 file /src=/cocoon://livres/livres.html 3031 3031 3031
> >>2 xslt /src=/resources/stylesheets/php/document2php.xsl
> >>46 46 46
> >>
> >>to get a php file whereas it takes arround 100 to get a "normal"
> >>skinned HTML page...
> >
> >I don't understand how this can be the case since an internal request
> >for "cocoon://{1}{2}.html" is identical to a client request for
> >http://localhost/{1}/{2}.html
> >
> >Your output from the profiler above shows only 46ms for document2php.xsl.
>
> I know that my stylesheet - document2php.xsl - is fast enough, it has a
> single pattern to match...
> My problem is with the 3031ms ! to generate the HTML file before the
> <php> tag cleanning !
>
> >Are you sure you are comparing like with like?
>
> No ;-) ,
You will need to be very careful to read the Profiling
info correctly. I am still experimenting with the facility.
There is discussion about how to interpret the values
somewhere in the forrest-dev archives and some in the
howto-dev.html
The repeated numbers indicate that it is not being cached
(or when small, they might equate to cache-access time).
The large number for livres.html might be the total for
that pipeline, composed of other pieces. Can you follow
through links on that pipeline?
Also see discussion on those dev threads. In some situations
that time also includes time spent in other sitemap components.
Putting LogTransformers before and after that sitemap component
will help to isolate any "extra" time.
This should be addressed on the dev list, but are you
using the new "dispatcher" for this site. If so, then we
already know that there are issues. Please discuss on dev.
-David
Re: Quick way to skin php-files?
Posted by Cyriaque Dupoirieux <Cy...@pcotech.fr>.
Ross Gardler a écrit :
> Cyriaque Dupoirieux wrote:
>
>> Cyriaque Dupoirieux a écrit :
>>
>>> Ross, I have to go now, I'll be back on thursday...
>>> Thank you for your help,
>>>
>>> Cyriaque,
>>>
>>>
>>>
>>> Ross Gardler a écrit :
>>>
>>>> Cyriaque Dupoirieux wrote:
>>>>
>>>>> Ferdinand Soethe a écrit :
>>>>>
>>>>>>> This is untested, but would be where I would start experimenting
>>>>>>> and I'm
>>>>>>> pretty sure is close to correct (maybe even correct ;-).
>>>>>>>
>>>>>>
>>>>>>
>>>>>> Thanks Ross, that was exactly what I was looking for. I just didn't
>>>>>> know where to intercept. Will give it a try right away ...
>>>>>>
>>>>> Hi,
>>>>>
>>>>> I made this in my php pipeline :
>>>>> <map:pipeline>
>>>>>
>>>>> <!-- PHP Documentation -->
>>>>> <map:match type="regexp" pattern="^(.*?)([^/]*).php$">
>>>>> <map:generate src="cocoon://{1}{2}.html"/>
>>>>> <map:transform
>>>>> src="resources/stylesheets/php/document2php.xsl"/>
>>>>> <map:serialize type="html"/>
>>>>> </map:match>
>>>>
>>>>
>>>> What does document2php.xsl do? Is this appraoch better for
>>>> Ferdinand than the one I suggest?
>>>
>>>
>> It just transform the <php> and </php> tags into *<?php* and *?>*...
>> In fact, I have created an output plugin for php format.
>> This plugin match php extension file in order to generate the skinned
>> HTML and clean the <php> and </php> tags between which I put php calls.
>>
>> On the paper it was simple, my problem is the horible performance I
>> get to generate the skinned HTML.
>> With the Cocoon Profile I get :
>> 1 file /src=/cocoon://livres/livres.html 3031 3031 3031
>> 2 xslt /src=/resources/stylesheets/php/document2php.xsl
>> 46 46 46
>>
>> to get a php file whereas it takes arround 100 to get a "normal"
>> skinned HTML page...
>
>
> I don't understand how this can be the case since an internal request
> for "cocoon://{1}{2}.html" is identical to a client request for
> http://localhost/{1}/{2}.html
>
> Your output from the profiler above shows only 46ms for document2php.xsl.
I know that my stylesheet - document2php.xsl - is fast enough, it has a
single pattern to match...
My problem is with the 3031ms ! to generate the HTML file before the
<php> tag cleanning !
>
> Are you sure you are comparing like with like?
No ;-) ,
>
> Ross
>
>
Re: Quick way to skin php-files?
Posted by Ross Gardler <rg...@apache.org>.
Cyriaque Dupoirieux wrote:
> Cyriaque Dupoirieux a écrit :
>
>> Ross, I have to go now, I'll be back on thursday...
>> Thank you for your help,
>>
>> Cyriaque,
>>
>>
>>
>> Ross Gardler a écrit :
>>
>>> Cyriaque Dupoirieux wrote:
>>>
>>>> Ferdinand Soethe a écrit :
>>>>
>>>>>> This is untested, but would be where I would start experimenting
>>>>>> and I'm
>>>>>> pretty sure is close to correct (maybe even correct ;-).
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Thanks Ross, that was exactly what I was looking for. I just didn't
>>>>> know where to intercept. Will give it a try right away ...
>>>>>
>>>>>
>>>>>
>>>> Hi,
>>>>
>>>> I made this in my php pipeline :
>>>> <map:pipeline>
>>>>
>>>> <!-- PHP Documentation -->
>>>> <map:match type="regexp" pattern="^(.*?)([^/]*).php$">
>>>> <map:generate src="cocoon://{1}{2}.html"/>
>>>> <map:transform src="resources/stylesheets/php/document2php.xsl"/>
>>>> <map:serialize type="html"/>
>>>> </map:match>
>>>
>>>
>>>
>>>
>>> What does document2php.xsl do? Is this appraoch better for Ferdinand
>>> than the one I suggest?
>>
>>
> It just transform the <php> and </php> tags into *<?php* and *?>*...
> In fact, I have created an output plugin for php format.
> This plugin match php extension file in order to generate the skinned
> HTML and clean the <php> and </php> tags between which I put php calls.
>
> On the paper it was simple, my problem is the horible performance I get
> to generate the skinned HTML.
> With the Cocoon Profile I get :
> 1 file /src=/cocoon://livres/livres.html 3031 3031 3031
> 2 xslt /src=/resources/stylesheets/php/document2php.xsl 46
> 46 46
>
> to get a php file whereas it takes arround 100 to get a "normal" skinned
> HTML page...
I don't understand how this can be the case since an internal request
for "cocoon://{1}{2}.html" is identical to a client request for
http://localhost/{1}/{2}.html
Your output from the profiler above shows only 46ms for document2php.xsl.
Are you sure you are comparing like with like?
Ross
Re: Quick way to skin php-files?
Posted by Cyriaque Dupoirieux <Cy...@pcotech.fr>.
Cyriaque Dupoirieux a écrit :
> Ross, I have to go now, I'll be back on thursday...
> Thank you for your help,
>
> Cyriaque,
>
>
>
> Ross Gardler a écrit :
>
>> Cyriaque Dupoirieux wrote:
>>
>>> Ferdinand Soethe a écrit :
>>>
>>>>> This is untested, but would be where I would start experimenting
>>>>> and I'm
>>>>> pretty sure is close to correct (maybe even correct ;-).
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Thanks Ross, that was exactly what I was looking for. I just didn't
>>>> know where to intercept. Will give it a try right away ...
>>>>
>>>>
>>>>
>>> Hi,
>>>
>>> I made this in my php pipeline :
>>> <map:pipeline>
>>>
>>> <!-- PHP Documentation -->
>>> <map:match type="regexp" pattern="^(.*?)([^/]*).php$">
>>> <map:generate src="cocoon://{1}{2}.html"/>
>>> <map:transform src="resources/stylesheets/php/document2php.xsl"/>
>>> <map:serialize type="html"/>
>>> </map:match>
>>
>>
>>
>> What does document2php.xsl do? Is this appraoch better for Ferdinand
>> than the one I suggest?
>
It just transform the <php> and </php> tags into *<?php* and *?>*...
In fact, I have created an output plugin for php format.
This plugin match php extension file in order to generate the skinned
HTML and clean the <php> and </php> tags between which I put php calls.
On the paper it was simple, my problem is the horible performance I get
to generate the skinned HTML.
With the Cocoon Profile I get :
1 file /src=/cocoon://livres/livres.html 3031 3031 3031
2 xslt /src=/resources/stylesheets/php/document2php.xsl 46
46 46
to get a php file whereas it takes arround 100 to get a "normal" skinned
HTML page...
>>
>>> </map:pipeline>
>>> And I realise with the cocoon profiler - thank you Ross - that it takes
>>
>>
>>
>> (don't thank me for the profiler that was Ron and Davids excellent
>> work - and the Cocoon community of course)
>>
>>> lot of time to call the <map:generate src="cocoon://{1}{2}.html"/> -
>>> and certainly lots of CPU because with dozens of php files I get an
>>> Out of Memory... -
>>
>>
>>
>> It should take no longer to request cocoon//**.html that it does to
>> request it via your browser. So the issue is not really with you
>> approach to including PHP stuff, rather with the generaton of the
>> original HTML stuff.
>>
>> Are you using the locationmap to retrieve remote files in this request?
>
No, all is local...
>>
>> Ross
>>
>>
>
>
Re: meta tag pass through?
Posted by Ross Gardler <rg...@apache.org>.
Moshe Yudkowsky wrote:
> I see that the "meta" tag is supported in the DTD for version 20
> documents, but does the rest of the system support the tag, and if so,
> how so?
There was some discussion on the dev list some time ago, the most
important post in that thread was:
http://marc.theaimsgroup.com/?l=forrest-dev&m=110324061019177&w=2
I'm not sure if this thread ever ended up as a commit to the code base,
it is worth you reading the whole thread, and, if no patch was ever sent
to bring all the ideas together we would welcome one since you seem to
have the need for this.
Ross
meta tag pass through?
Posted by Moshe Yudkowsky <ms...@bl.com>.
I see that the "meta" tag is supported in the DTD for version 20
documents, but does the rest of the system support the tag, and if so,
how so?
I've tried to add, to site2xhtml.xsl, the following:
> <xsl:apply-templates select="meta"/>
and a template
> <xsl:template match="meta">
> <xsl:for-each select="meta">
> <xsl:element name="meta">
> <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
> <xsl:attribute name="content"><xsl:value-of select="."/></xsl:attribute>
> <xsl:if test="@xml:lang">
> <xsl:attribute name="lang"><xsl:value-of select="@xml:lang"/></xsl:attribute>
> </xsl:if>
> </xsl:element>
> </xsl:for-each>
> </xsl:template>
but now I'm wondering if I have any <meta> tags coming through the
pipeline to this point, or if I've got a silly error that makes the
entire exercise pointless!
Regards,
Moshe
Re: URLs contain ampersand on output
Posted by David Crossley <cr...@apache.org>.
Ross Gardler wrote:
> Moshe Yudkowsky wrote:
> >I just ran my forrest files through a validator, and to my dismay I see
> >that there's a problem.
> >
> >In site.xml, some of the URLs I enter have an "&" character in them. I
> >write these as HTML entities; otherwise site.xml won't validate.
> >
> >The output of forrest has "&" in the URLs. That would be fine, except
> >that the page won't validate; the source code of the page has to use an
> >entity for "&" in the URLs.
> >
> >I can't find a setting anywhere (forrest.properties, skinconf.xml., or
> >the xslt files) that would change this behavior.
> >
> >Help?
>
> Please raise an issue on our issue tracker for this, and if Helena's
> work around is good, please add a note about that.
Perhaps it is this ...
http://issues.apache.org/jira/browse/FOR-241
"character entities (e.g. ampersand) are expanded again for href or src attributes"
-David
Re: URLs contain ampersand on output
Posted by Ross Gardler <rg...@apache.org>.
Moshe Yudkowsky wrote:
> I just ran my forrest files through a validator, and to my dismay I see
> that there's a problem.
>
> In site.xml, some of the URLs I enter have an "&" character in them. I
> write these as HTML entities; otherwise site.xml won't validate.
>
> The output of forrest has "&" in the URLs. That would be fine, except
> that the page won't validate; the source code of the page has to use an
> entity for "&" in the URLs.
>
> I can't find a setting anywhere (forrest.properties, skinconf.xml., or
> the xslt files) that would change this behavior.
>
> Help?
Please raise an issue on our issue tracker for this, and if Helena's
work around is good, please add a note about that.
Ross
Re: URLs contain ampersand on output
Posted by David Crossley <cr...@apache.org>.
Moshe Yudkowsky wrote:
> David Crossley wrote:
>
> > Perhaps it is this ...
> > http://issues.apache.org/jira/browse/FOR-241
> > "character entities (e.g. ampersand) are expanded again for href or
> src attributes"
>
> That is indeed the issue. But I didn't understand the resolution; does
> that mean I need to use 0.8-dev to get the fix incorporated?
There is no resolution. The Bug is still open.
> Ross, I will assume that since David's issue tracked this, I don't need
> to raise a separate issue on the tracker.
Correct.
-David
Re: URLs contain ampersand on output
Posted by CFAS Webmaster <we...@cfas.org>.
Moshe Yudkowsky wrote:
>
> I wrote:
> >>
> >>>I just ran my forrest files through a validator, and to my dismay I
> see
> >>>that there's a problem.
> >>>
> >>>In site.xml, some of the URLs I enter have an "&" character in them. I
> >>>write these as HTML entities; otherwise site.xml won't validate.
>
> [snip]
> If I use "&amp;", I get & resulting html output. That works
> and that validates, so that will be my workaround in the meantime.
> [snip]
However, putting this into the issue comments would help others find the
workaround until this is fixed...
-Paul
workaround for && in xdocs/*
Posted by Helena Edelson <he...@greenjaguar.com>.
this workaround works for links with "&" in the URL when the link is in
xdocs/
here is an example of one I used:
http://www.tranexp.com:2000/InterTran?url=http%3A%2F%2Fwww.summitjournal.com&type=text&text=&from=eng&to=fin
both in site.xml and in xdocs/translate.xml type content files.
I am not sure why it won't work for your dev but I am using F7 not F8
If this helps anyone I also successfully used:
&& in place of && in xslt files also for those bleak times I
have to rely on a small javascript.
& won't work neither will or any of those. just get a good
ascii ref to keep the validators happy.
Helena
Moshe Yudkowsky wrote:
>
> I wrote:
> >>
> >>>I just ran my forrest files through a validator, and to my dismay I
> see
> >>>that there's a problem.
> >>>
> >>>In site.xml, some of the URLs I enter have an "&" character in them. I
> >>>write these as HTML entities; otherwise site.xml won't validate.
>
> Helena Edelson wrote:
>
> > concat and replace & with & your url's.
>
> If I use "&" instead of & in the url in site.xml, I have the
> same problem.
>
> If I use "&amp;", I get & resulting html output. That works
> and that validates, so that will be my workaround in the meantime.
>
>
> David Crossley wrote:
>
> > Perhaps it is this ...
> > http://issues.apache.org/jira/browse/FOR-241
> > "character entities (e.g. ampersand) are expanded again for href or
> src attributes"
>
> That is indeed the issue. But I didn't understand the resolution; does
> that mean I need to use 0.8-dev to get the fix incorporated?
>
> Ross, I will assume that since David's issue tracked this, I don't
> need to raise a separate issue on the tracker.
>
>
Re: URLs contain ampersand on output
Posted by Moshe Yudkowsky <ms...@bl.com>.
I wrote:
>>
>>>I just ran my forrest files through a validator, and to my dismay I see
>>>that there's a problem.
>>>
>>>In site.xml, some of the URLs I enter have an "&" character in them. I
>>>write these as HTML entities; otherwise site.xml won't validate.
Helena Edelson wrote:
> concat and replace & with & your url's.
If I use "&" instead of & in the url in site.xml, I have the
same problem.
If I use "&amp;", I get & resulting html output. That works and
that validates, so that will be my workaround in the meantime.
David Crossley wrote:
> Perhaps it is this ...
> http://issues.apache.org/jira/browse/FOR-241
> "character entities (e.g. ampersand) are expanded again for href or
src attributes"
That is indeed the issue. But I didn't understand the resolution; does
that mean I need to use 0.8-dev to get the fix incorporated?
Ross, I will assume that since David's issue tracked this, I don't need
to raise a separate issue on the tracker.
--
Moshe Yudkowsky
work: http://www.Disaggregate.com
book: http://www.PebbleAndAvalanche.com
Re: URLs contain ampersand on output
Posted by Helena Edelson <he...@greenjaguar.com>.
sorry, forgot to mention - make sure to concat and replace & with &
your url's.
Helena Edelson wrote:
> try the ascii version in place of &
>
> Moshe Yudkowsky wrote:
>
>> I just ran my forrest files through a validator, and to my dismay I
>> see that there's a problem.
>>
>> In site.xml, some of the URLs I enter have an "&" character in them.
>> I write these as HTML entities; otherwise site.xml won't validate.
>>
>> The output of forrest has "&" in the URLs. That would be fine, except
>> that the page won't validate; the source code of the page has to use
>> an entity for "&" in the URLs.
>>
>> I can't find a setting anywhere (forrest.properties, skinconf.xml.,
>> or the xslt files) that would change this behavior.
>>
>> Help?
>>
>>
>>
>>
Re: URLs contain ampersand on output
Posted by Helena Edelson <he...@greenjaguar.com>.
try the ascii version in place of &
Moshe Yudkowsky wrote:
> I just ran my forrest files through a validator, and to my dismay I
> see that there's a problem.
>
> In site.xml, some of the URLs I enter have an "&" character in them. I
> write these as HTML entities; otherwise site.xml won't validate.
>
> The output of forrest has "&" in the URLs. That would be fine, except
> that the page won't validate; the source code of the page has to use
> an entity for "&" in the URLs.
>
> I can't find a setting anywhere (forrest.properties, skinconf.xml., or
> the xslt files) that would change this behavior.
>
> Help?
>
>
>
>
URLs contain ampersand on output
Posted by Moshe Yudkowsky <ms...@bl.com>.
I just ran my forrest files through a validator, and to my dismay I see
that there's a problem.
In site.xml, some of the URLs I enter have an "&" character in them. I
write these as HTML entities; otherwise site.xml won't validate.
The output of forrest has "&" in the URLs. That would be fine, except
that the page won't validate; the source code of the page has to use an
entity for "&" in the URLs.
I can't find a setting anywhere (forrest.properties, skinconf.xml., or
the xslt files) that would change this behavior.
Help?
Re: Quick way to skin php-files?
Posted by Cyriaque Dupoirieux <Cy...@pcotech.fr>.
Ross, I have to go now, I'll be back on thursday...
Thank you for your help,
Cyriaque,
Ross Gardler a écrit :
> Cyriaque Dupoirieux wrote:
>
>> Ferdinand Soethe a écrit :
>>
>>>> This is untested, but would be where I would start experimenting
>>>> and I'm
>>>> pretty sure is close to correct (maybe even correct ;-).
>>>>
>>>
>>>
>>>
>>> Thanks Ross, that was exactly what I was looking for. I just didn't
>>> know where to intercept. Will give it a try right away ...
>>>
>>>
>>>
>> Hi,
>>
>> I made this in my php pipeline :
>> <map:pipeline>
>>
>> <!-- PHP Documentation -->
>> <map:match type="regexp" pattern="^(.*?)([^/]*).php$">
>> <map:generate src="cocoon://{1}{2}.html"/>
>> <map:transform src="resources/stylesheets/php/document2php.xsl"/>
>> <map:serialize type="html"/>
>> </map:match>
>
>
> What does document2php.xsl do? Is this appraoch better for Ferdinand
> than the one I suggest?
>
>> </map:pipeline>
>> And I realise with the cocoon profiler - thank you Ross - that it takes
>
>
> (don't thank me for the profiler that was Ron and Davids excellent
> work - and the Cocoon community of course)
>
>> lot of time to call the <map:generate src="cocoon://{1}{2}.html"/> -
>> and certainly lots of CPU because with dozens of php files I get an
>> Out of Memory... -
>
>
> It should take no longer to request cocoon//**.html that it does to
> request it via your browser. So the issue is not really with you
> approach to including PHP stuff, rather with the generaton of the
> original HTML stuff.
>
> Are you using the locationmap to retrieve remote files in this request?
>
> Ross
>
>
Re: Quick way to skin php-files?
Posted by Ross Gardler <rg...@apache.org>.
Cyriaque Dupoirieux wrote:
> Ferdinand Soethe a écrit :
>
>>> This is untested, but would be where I would start experimenting and I'm
>>> pretty sure is close to correct (maybe even correct ;-).
>>>
>>
>>
>> Thanks Ross, that was exactly what I was looking for. I just didn't
>> know where to intercept. Will give it a try right away ...
>>
>>
>>
> Hi,
>
> I made this in my php pipeline :
> <map:pipeline>
>
> <!-- PHP Documentation -->
> <map:match type="regexp" pattern="^(.*?)([^/]*).php$">
> <map:generate src="cocoon://{1}{2}.html"/>
> <map:transform src="resources/stylesheets/php/document2php.xsl"/>
> <map:serialize type="html"/>
> </map:match>
What does document2php.xsl do? Is this appraoch better for Ferdinand
than the one I suggest?
> </map:pipeline>
> And I realise with the cocoon profiler - thank you Ross - that it takes
(don't thank me for the profiler that was Ron and Davids excellent work
- and the Cocoon community of course)
> lot of time to call the <map:generate src="cocoon://{1}{2}.html"/> - and
> certainly lots of CPU because with dozens of php files I get an Out of
> Memory... -
It should take no longer to request cocoon//**.html that it does to
request it via your browser. So the issue is not really with you
approach to including PHP stuff, rather with the generaton of the
original HTML stuff.
Are you using the locationmap to retrieve remote files in this request?
Ross
Re: Quick way to skin php-files?
Posted by Cyriaque Dupoirieux <Cy...@pcotech.fr>.
Ferdinand Soethe a écrit :
>>This is untested, but would be where I would start experimenting and I'm
>>pretty sure is close to correct (maybe even correct ;-).
>>
>>
>
>Thanks Ross, that was exactly what I was looking for. I just didn't
>know where to intercept. Will give it a try right away ...
>
>
>
Hi,
I made this in my php pipeline :
<map:pipeline>
<!-- PHP Documentation -->
<map:match type="regexp" pattern="^(.*?)([^/]*).php$">
<map:generate src="cocoon://{1}{2}.html"/>
<map:transform src="resources/stylesheets/php/document2php.xsl"/>
<map:serialize type="html"/>
</map:match>
</map:pipeline>
And I realise with the cocoon profiler - thank you Ross - that it takes
lot of time to call the <map:generate src="cocoon://{1}{2}.html"/> - and
certainly lots of CPU because with dozens of php files I get an Out of
Memory... -
Here is an example of the profiler for a small php page :
*livres/livres.php* (2 results, total time: 4720, average time: 2360) 0
<http://localhost:8888/cprofile.html?key=3889731732187908544&result=0>
1 <http://localhost:8888/cprofile.html?key=3889731732187908544&result=1>
1 file /src=/cocoon://livres/livres.html 3031 3031 3031
2 xslt /src=/resources/stylesheets/php/document2php.xsl 46 46 46
3 html 16 16 16
4 TOTAL 2360 3891 829
*livres/livres.xml* (4 results, total time: 46, average time: 11) 0
<http://localhost:8888/cprofile.html?key=-8345536717863364507&result=0> 1
<http://localhost:8888/cprofile.html?key=-8345536717863364507&result=1> 2
<http://localhost:8888/cprofile.html?key=-8345536717863364507&result=2> 3
<http://localhost:8888/cprofile.html?key=-8345536717863364507&result=3>
1
file /src=/D:\duc\VIEWSI~1/src/documentation/content/xdocs/livres/livres.xml
4 0 16 0 0
2 xml-document 11 0 0 15 31
3 TOTAL 11 0 0 15 31
What's wrong with me - or exactly what's wrong with my pipeline ;-) ?
Salutations,
Cyriaque,
>OK. I put this
>
><!-- php Pilelines -->
> <!--pipeline that "marries" the docs in the root dir with the skin to produce html-->
> <map:match pattern="*.php">
> <map:aggregate element="site">
> <map:part src="cocoon:/skinconf.xml"/>
> <map:part src="cocoon:/build-info"/>
> <map:part src="cocoon:/tab-{1}.html"/>
> <map:part src="cocoon:/menu-{1}.html"/>
> <map:part src="cocoon:/body-{1}.html"/>
> </map:aggregate>
>
> <map:call resource="skinit">
> <map:parameter name="type" value="site2xhtml"/>
> <map:parameter name="path" value="{1}.html"/>
> </map:call>
> </map:match>
> <!--pipeline that "marries" the docs in all other dirs then root with the skin to produce html-->
> <map:match pattern="**/*.php">
> <map:aggregate element="site">
> <map:part src="cocoon:/skinconf.xml"/>
> <map:part src="cocoon:/build-info"/>
> <map:part src="cocoon:/{1}/tab-{2}.html"/>
> <map:part src="cocoon:/{1}/menu-{2}.html"/>
> <map:part src="cocoon:/{1}/body-{2}.html"/>
> </map:aggregate>
> <map:call resource="skinit">
> <map:parameter name="type" value="site2xhtml"/>
> <map:parameter name="path" value="{1}.html"/>
> </map:call>
> </map:match>
>
>into my custom sitemap and copied the skinit-ressource into it as well
>(because Forrest complained).
>
>Then I entered a href of
>
> abc.php
>
>into my sitemap and placed the html-document
>abc.html into xdocs.
>
>However trying that menu-item I only received this rather unspecific
>error message:
>
>Message: null
>Description: No details available.
>Sender: org.apache.cocoon.servlet.CocoonServlet
>Source: Cocoon Servlet
>Request URI
>anmeldungPHP.php
>cause
>null
>request-uri
>/anmeldungPHP.php
>
>Any ideas?
>
>--
>Ferdinand Soethe
>
>
>
>
Re: Quick way to skin php-files?
Posted by Ferdinand Soethe <fe...@apache.org>.
> This is untested, but would be where I would start experimenting and I'm
> pretty sure is close to correct (maybe even correct ;-).
Thanks Ross, that was exactly what I was looking for. I just didn't
know where to intercept. Will give it a try right away ...
OK. I put this
<!-- php Pilelines -->
<!--pipeline that "marries" the docs in the root dir with the skin to produce html-->
<map:match pattern="*.php">
<map:aggregate element="site">
<map:part src="cocoon:/skinconf.xml"/>
<map:part src="cocoon:/build-info"/>
<map:part src="cocoon:/tab-{1}.html"/>
<map:part src="cocoon:/menu-{1}.html"/>
<map:part src="cocoon:/body-{1}.html"/>
</map:aggregate>
<map:call resource="skinit">
<map:parameter name="type" value="site2xhtml"/>
<map:parameter name="path" value="{1}.html"/>
</map:call>
</map:match>
<!--pipeline that "marries" the docs in all other dirs then root with the skin to produce html-->
<map:match pattern="**/*.php">
<map:aggregate element="site">
<map:part src="cocoon:/skinconf.xml"/>
<map:part src="cocoon:/build-info"/>
<map:part src="cocoon:/{1}/tab-{2}.html"/>
<map:part src="cocoon:/{1}/menu-{2}.html"/>
<map:part src="cocoon:/{1}/body-{2}.html"/>
</map:aggregate>
<map:call resource="skinit">
<map:parameter name="type" value="site2xhtml"/>
<map:parameter name="path" value="{1}.html"/>
</map:call>
</map:match>
into my custom sitemap and copied the skinit-ressource into it as well
(because Forrest complained).
Then I entered a href of
abc.php
into my sitemap and placed the html-document
abc.html into xdocs.
However trying that menu-item I only received this rather unspecific
error message:
Message: null
Description: No details available.
Sender: org.apache.cocoon.servlet.CocoonServlet
Source: Cocoon Servlet
Request URI
anmeldungPHP.php
cause
null
request-uri
/anmeldungPHP.php
Any ideas?
--
Ferdinand Soethe
Re: Quick way to skin php-files?
Posted by Ross Gardler <rg...@apache.org>.
Ferdinand Soethe wrote:
> David Crossley wrote:
>
>
>>I gather that you are saying that the XML Processing Instructions
>>(PI) get stripped somewhere by one of the transformations.
>
>
> No, they pass through ok if I embedd them into an html-page. Problem
> is that the final page needs to have the .php-extension for the Server
> to process it correctly. And when I change the extension of the file
> from html to php our pipelines don't want to skin it anymore. Too many
> extension-based matchers along the route I suppose.
If you have control over the server you can control which pages ares
processed by the PHP engine. However, changing it to process all html
pages would be a performance problem since I guess many HTML files will
not contain PHP elements.
If I understand correctly you want to have Forrest generate *.php files
which will then be processed by the PHP engine. That is Forrest is *not*
processing the PHP itself. It is easy to create a pipeline for this.
Rather than sharing the code offlist can I suggest that the relevant
pipeline snippets are shared online so that others can benefit (better
still submit a plugin to the project).
In the absence of this, all you (should) need to do is copy the two HTML
matchers in sitemap.xmap (pattern="*.html" and pattern="**/*.html") with
identical matchers put looking for the php extension, i.e.
pattern="*.php" and pattern="**/*.php"
Then, in each place where {0} appears change it to {1}.html (this is
because {0} includes the extension of the match). This assumes that our
internal processing allows the PHP tags to pass through corectly. You
appear to confirm this above.
Note, this will result in any document that would normally be processed
by Forrest to create an HTML page being able to include PHP elements as
well (assuming that you can encode them in the source format of course).
FOr example, if you turn of validation you could include the elements in
an XDoc.
WARNING
This is untested, but would be where I would start experimenting and I'm
pretty sure is close to correct (maybe even correct ;-).
Ross
Re: Quick way to skin php-files?
Posted by Ferdinand Soethe <fe...@apache.org>.
David Crossley wrote:
> I gather that you are saying that the XML Processing Instructions
> (PI) get stripped somewhere by one of the transformations.
No, they pass through ok if I embedd them into an html-page. Problem
is that the final page needs to have the .php-extension for the Server
to process it correctly. And when I change the extension of the file
from html to php our pipelines don't want to skin it anymore. Too many
extension-based matchers along the route I suppose.
--
Ferdinand Soethe
Re: Quick way to skin php-files?
Posted by David Crossley <cr...@apache.org>.
Ferdinand Soethe wrote:
>
> I'm looking for a simple way og integrating documents with php-function
> calls (that generate content) into a Forrest Website. To be precise,
>
> I want to place an html-document with something like <?....> within
> its body into my Forrest and generate a skinned document with the
> ending .php (and the unchanged <?....> within its body) so that I can
> place this on a php-enabled server and use external scripts.
>
> Note: I'm not expecting the php-function calls to be resolved by
> Forrest, I merely want the document skinned and php-calls passed
> intact.
>
> Any suggestions?
I gather that you are saying that the XML Processing Instructions
(PI) get stripped somewhere by one of the transformations.
One way to find out where, is to view the actual xml stream
at each pipeline. Use the Cocoon profiler and follow the links
to see the actual xml.
http://forrest.apache.org/docs/dev/howto/howto-dev.html#debug-cocoon-profiler
-David