You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Michael Thermos <mt...@gmail.com> on 2005/07/26 02:39:25 UTC

html -2- xhtml - 2- xsl - fo

Hallo !
I'm a new student of cocoon and i needed to convert a cform to pdf. I
asked help for a friend
who suggested i should read 
http://www.mail-archive.com/cocoon-users@xml.apache.org/msg17073.html
where it is suggested to use a double transform to avoid hard xsl code writing.

Unfortunatly this is not working. I did found some xsl files like the
ones suggested in the example
but i keep running into saxparser exceptions, indicating mis formed
xsl problems.
I believe the problem are the xsl files.

If anyone has solved this problem with some xsl files, would it be so
kind to send them, or if they are copyrighted, give some suggestions?

Thanks,
M.Thermos

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: html -2- xhtml - 2- xsl - fo

Posted by Joerg Heinicke <jo...@gmx.de>.
On 26.07.2005 02:39, Michael Thermos wrote:

> Hallo !
> I'm a new student of cocoon and i needed to convert a cform to pdf. I
> asked help for a friend
> who suggested i should read 
> http://www.mail-archive.com/cocoon-users@xml.apache.org/msg17073.html
> where it is suggested to use a double transform to avoid hard xsl code writing.
> 
> Unfortunatly this is not working. I did found some xsl files like the
> ones suggested in the example but i keep running into saxparser exceptions,
 > indicating mis formed xsl problems.
> I believe the problem are the xsl files.
> 
> If anyone has solved this problem with some xsl files, would it be so
> kind to send them, or if they are copyrighted, give some suggestions?

I guess the two mentioned xsl files do not exist in that way you need 
it. Of course somebody might have working examples, but probably not in 
all the complexity that is possible and you probably need.

The concerns about this approach mentioned in the thread are still valid 
and the prefered way should still be XML => XSL Fo and XML => XHTML.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


[cforms] Access a results page after submitting a form (was previously: html -2- xhtml - 2- xsl - fo)

Posted by Michael Thermos <mt...@gmail.com>.
Please forgive me for emailing this thread now to the dev list, but i
got no replies
from the user list, and i'm still stuck on the same problem.

Best regards,
M.Thermos


---------- Forwarded message ----------
From: Michael Thermos <mt...@gmail.com>
Date: Jul 30, 2005 12:46 PM
Subject: Re: Access a results page after submitting a form (was
previously: html -2- xhtml - 2- xsl - fo)
To: users@cocoon.apache.org


Hallo Mark and other cocoon users.
This is my pipeline for test purposes:

<map:match pattern="test.pdf">
<map:generate type="html"
src="context://reports/forms/reports_success_jx.xml" />
<map:transform src="context://reports/resources/xhtml2fo.xsl" />
<map:serialize type="fo2pdf" mime-type="application/pdf" />
</map:match>

My idea was to have a link on the results page that triggered the
pipeline above.
This test pipeline makes me run into two problems:
  1st-   the printed pdf page hasn't the results submitted by the form
  2nd - the "print to pdf link" is included in the pdf!

As a solution to 1st i tried a pipeline with
<map: generate type="html" src="#{$cocoon/continuation/id}" />
Problem: didn't work :(

Solutions to 2nd could be:
 (a) to remove the code responsible for link translation in the xsl stylesheet
       Problem: what if in the future i need links in the pdf??
 (b) having a results page in a frame, and the link to pdf generation on another
   frame.
     Problem: JxTemplateGenerator "doesn't like"(that it,
   doesn't generate) the frames...Maybe i should try xsp...

Thanks,
M.Thermos


On 7/28/05, Mark Lundquist <ml...@wrinkledog.com> wrote:
>
> On Jul 28, 2005, at 7:37 AM, Michael Thermos wrote:
>
> > Hallo. Again.
>
> Hiya :-)
>
> >
> > I'm using JXTemplateGenerator to pass values from the form to the
> > results page.
> > Here is a bit of code:
> >      <map:match pattern="*-success-pipeline.jx">
> >        <map:generate type="jx" src="forms/{1}_success_jx.xml"/>
> >        <map:call resource="simple-page2html">
> >          <map:parameter name="file" value="forms/{1}_success_jx.xml"/>
> >        </map:call>
> >        <map:serialize/>
> >      </map:match>
> >
> > My results page from a cform(that is after submiting the form) has an
> > url like
> > http://localhost:8080/cocoon/test/
> > 6267201137490a377a5f79257a3810544b391352.continue
> >
> > I'm trying to use a genarator  like
> > <map: generate type="html" src="#{$cocoon/continuation/id}" />
>
> Ah, no... that doesn't have any meaning.
>
> You need a pipeline that looks something like this (maybe not exactly,
> it depends how you're structuring your URI space, subsitemaps etc.):
>
>              <map:match pattern="*.continue">
>                         <map:call continuation="{1}"/>
>              </map:match>
>
> Please post your flowscript function that invokes the form (and should
> then do something after the form is submitted), because I suspect
> you're going to have some problems there too, so might as well get it
> out on the table now :-)
>
> —ml—
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Access a results page after submitting a form (was previously: html -2- xhtml - 2- xsl - fo)

Posted by Michael Thermos <mt...@gmail.com>.
Hallo Mark.
This is my pipeline for test purposes:

<map:match pattern="test.pdf">
<map:generate type="html"
src="context://reports/forms/reports_success_jx.xml" />
<map:transform src="context://reports/resources/xhtml2fo.xsl" /> 
<map:serialize type="fo2pdf" mime-type="application/pdf" /> 
</map:match>

My idea was to have a link on the results page that triggered the
pipeline above.
This test pipeline makes me run into two problems:
  1st-   the printed pdf page hasn't the results submitted by the form
  2nd - the "print to pdf link" is included in the pdf!

As a solution to 1st i tried a pipeline with
<map: generate type="html" src="#{$cocoon/continuation/id}" />
Problem: didn't work :(  

Solutions to 2nd could be:
 (a) to remove the code responsible for link translation in the xsl stylesheet
       Problem: what if in the future i need links in the pdf??
 (b) having a results page in a frame, and the link to pdf generation on another
   frame. 
     Problem: JxTemplateGenerator "doesn't like"(that it,    
   doesn't generate) the frames...Maybe i should try xsp...

Thanks,
M.Thermos


On 7/28/05, Mark Lundquist <ml...@wrinkledog.com> wrote:
> 
> On Jul 28, 2005, at 7:37 AM, Michael Thermos wrote:
> 
> > Hallo. Again.
> 
> Hiya :-)
> 
> >
> > I'm using JXTemplateGenerator to pass values from the form to the
> > results page.
> > Here is a bit of code:
> >      <map:match pattern="*-success-pipeline.jx">
> >        <map:generate type="jx" src="forms/{1}_success_jx.xml"/>
> >        <map:call resource="simple-page2html">
> >          <map:parameter name="file" value="forms/{1}_success_jx.xml"/>
> >        </map:call>
> >        <map:serialize/>
> >      </map:match>
> >
> > My results page from a cform(that is after submiting the form) has an
> > url like
> > http://localhost:8080/cocoon/test/
> > 6267201137490a377a5f79257a3810544b391352.continue
> >
> > I'm trying to use a genarator  like
> > <map: generate type="html" src="#{$cocoon/continuation/id}" />
> 
> Ah, no... that doesn't have any meaning.
> 
> You need a pipeline that looks something like this (maybe not exactly,
> it depends how you're structuring your URI space, subsitemaps etc.):
> 
>              <map:match pattern="*.continue">
>                         <map:call continuation="{1}"/>
>              </map:match>
> 
> Please post your flowscript function that invokes the form (and should
> then do something after the form is submitted), because I suspect
> you're going to have some problems there too, so might as well get it
> out on the table now :-)
> 
> —ml—
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
>

Re: Access a results page after submitting a form (was previously: html -2- xhtml - 2- xsl - fo)

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jul 28, 2005, at 7:37 AM, Michael Thermos wrote:

> Hallo. Again.

Hiya :-)

>
> I'm using JXTemplateGenerator to pass values from the form to the
> results page.
> Here is a bit of code:
>      <map:match pattern="*-success-pipeline.jx">
>        <map:generate type="jx" src="forms/{1}_success_jx.xml"/>
>        <map:call resource="simple-page2html">
>          <map:parameter name="file" value="forms/{1}_success_jx.xml"/>
>        </map:call>
>        <map:serialize/>
>      </map:match>
>
> My results page from a cform(that is after submiting the form) has an  
> url like
> http://localhost:8080/cocoon/test/ 
> 6267201137490a377a5f79257a3810544b391352.continue
>
> I'm trying to use a genarator  like
> <map: generate type="html" src="#{$cocoon/continuation/id}" />

Ah, no... that doesn't have any meaning.

You need a pipeline that looks something like this (maybe not exactly,  
it depends how you're structuring your URI space, subsitemaps etc.):

	     <map:match pattern="*.continue">
        		<map:call continuation="{1}"/>
      	     </map:match>

Please post your flowscript function that invokes the form (and should  
then do something after the form is submitted), because I suspect  
you're going to have some problems there too, so might as well get it  
out on the table now :-)

—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Access a results page after submitting a form (was previously: html -2- xhtml - 2- xsl - fo)

Posted by Michael Thermos <mt...@gmail.com>.
Hallo. Again.

I'm using JXTemplateGenerator to pass values from the form to the
results page.Here is a bit of code:
     <map:match pattern="*-success-pipeline.jx">
       <map:generate type="jx" src="forms/{1}_success_jx.xml"/>
       <map:call resource="simple-page2html">
         <map:parameter name="file" value="forms/{1}_success_jx.xml"/>
       </map:call>
       <map:serialize/>
     </map:match>

My results page from a cform(that is after submiting the form) has an url like
http://localhost:8080/cocoon/test/6267201137490a377a5f79257a3810544b391352.continue

I'm trying to use a genarator  like
<map: generate type="html" src="#{$cocoon/continuation/id}" />
to pass my results page to xhtml.
The problem is i keep getting (Access is denied) error. 

Also tried 
<map: generate type="html" src="#{$cocoon/parent/continuation/id}" />
and it didn't work.

How can i access a results page after submitting a form??? 
I really need to do this so that later i can pass the xhtml to xsl-fo.



Thanks,
M.Thermos




On 7/26/05, Joerg Heinicke <jo...@gmx.de> wrote:
> On 26.07.2005 19:55, Michael Thermos wrote:
>
> > I just found a new html2xhtml(from docbook project) file which seems
> > to be working. The problem i stated previously i believed was dued to
> > calling a new pipeline before finishing the application control flow
> > with cocoon.sendPage(cocoon.sendPage("test-success-pipeline.jx",
> > bizdata);)
>
> As already written in the original thread there is no need or even use
> for a html2xhtml stylesheet. You only need a HTMLGenerator. I really
> wonder what this stylesheet is about.
>
> Joerg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: html -2- xhtml - 2- xsl - fo

Posted by Michael Thermos <mt...@gmail.com>.
Hallo. Again.
My results page from a cform has an url like
http://localhost:8080/cocoon/test/6267201137490a377a5f79257a3810544b391352.continue
i'm trying to use a genarator  like
<map: generate type="html" src="#{$cocoon/continuation/id}" />
to pass the html page to xhtml and then i already have a xsl to pass
to this xhtml to xsl-fo.
The problem is i keep getting (Access is denied) error.

Thanks Joerg und Holger for your time.
M.Thermos

On 7/26/05, Joerg Heinicke <jo...@gmx.de> wrote:
> On 26.07.2005 19:55, Michael Thermos wrote:
> 
> > I just found a new html2xhtml(from docbook project) file which seems
> > to be working. The problem i stated previously i believed was dued to
> > calling a new pipeline before finishing the application control flow
> > with cocoon.sendPage(cocoon.sendPage("test-success-pipeline.jx",
> > bizdata);)
> 
> As already written in the original thread there is no need or even use
> for a html2xhtml stylesheet. You only need a HTMLGenerator. I really
> wonder what this stylesheet is about.
> 
> Joerg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: html -2- xhtml - 2- xsl - fo

Posted by Joerg Heinicke <jo...@gmx.de>.
On 26.07.2005 19:55, Michael Thermos wrote:

> I just found a new html2xhtml(from docbook project) file which seems
> to be working. The problem i stated previously i believed was dued to
> calling a new pipeline before finishing the application control flow
> with cocoon.sendPage(cocoon.sendPage("test-success-pipeline.jx",
> bizdata);)

As already written in the original thread there is no need or even use 
for a html2xhtml stylesheet. You only need a HTMLGenerator. I really 
wonder what this stylesheet is about.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: html -2- xhtml - 2- xsl - fo

Posted by Michael Thermos <mt...@gmail.com>.
Hallo again.

I just found a new html2xhtml(from docbook project) file which seems
to be working. The problem i stated previously i believed was dued to
calling a new pipeline before finishing the application control flow
with cocoon.sendPage(cocoon.sendPage("test-success-pipeline.jx",
bizdata);)

I've followed Holger suggestion.It shows no problem. My problem now is
to "print" the page i'm seeing. Since the page i'm about to print is a
results page from a form, and the url displays something like
http://localhost:8080/cocoon/test/493d7431383c197d317d5d80404b546c4e654f19.continue
which should be the generate source to use on the pipeline?

<map:match pattern="hello.pdf">
<map:generate src="cocoon:/*.continue"/>
	    <map:transform src="context://reports/resources/html2xhtml.xsl" />
	    <map:transform src="context://reports/resources/xhtml2fo.xsl" />  
	    <map:serialize type="fo2pdf" mime-type="application/pdf" /> 
<!--   			<map:serialize type="xml"/> -->
   	</map:match>

Tried above code.Doesn't work.

Thanks.
MThermos

ps: Working with a really simple form model (only with
tabs,tables,selection-lists,radio-butons,text,dates) so if someone has
other xsl to do the job and could send = great!!! Web pointers also
welcome.

On 7/26/05, Joerg Heinicke <jo...@gmx.de> wrote:
> On 26.07.2005 16:10, Michael Thermos wrote:
> 
> > The problem with your suggestion is that it is throwing an exception
> > <map:call function> did not send a response, at
> > file:/C:/apache_tomcat/Tomcat%205.5/webapps/cocoon/test/sitemap.xmap:93:40
> > .
> > which is has related to handleForm function inside Forms.js .
> > Unfortunatly i don't know yet how to overcome this.
> 
> Are you sure? This is something completely different. Have you seen and
> added the additional <map:serialize type="xml"/> as Holger suggested?
> 
> Joerg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: html -2- xhtml - 2- xsl - fo

Posted by Joerg Heinicke <jo...@gmx.de>.
On 26.07.2005 16:10, Michael Thermos wrote:

> The problem with your suggestion is that it is throwing an exception 
> <map:call function> did not send a response, at
> file:/C:/apache_tomcat/Tomcat%205.5/webapps/cocoon/test/sitemap.xmap:93:40
> .
> which is has related to handleForm function inside Forms.js .
> Unfortunatly i don't know yet how to overcome this.

Are you sure? This is something completely different. Have you seen and 
added the additional <map:serialize type="xml"/> as Holger suggested?

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: html -2- xhtml - 2- xsl - fo

Posted by Michael Thermos <mt...@gmail.com>.
Hallo.
The problem with your suggestion is that it is throwing an exception 
<map:call function> did not send a response, at
file:/C:/apache_tomcat/Tomcat%205.5/webapps/cocoon/test/sitemap.xmap:93:40
.
which is has related to handleForm function inside Forms.js .
Unfortunatly i don't know yet how to overcome this.

Thanks,
M.Thermos



On 7/26/05, holger.willenborg@armacell.com
<ho...@armacell.com> wrote:
>  
> Hi, 
>  
> I suggest you try to find out where the error occurs using something like
> this: 
>  
> <map:match pattern="*/**.pdf">
>    <map:generate src="xml/{2}.xml"/>
>    <map:transform src="stylesheets/{1}.xsl" /> 
>         <!-- Now output the result so far as XML --> 
>    <map:serialize type="xml"/> 
>  
>     <!-- comment this out to test only the above -->
>    <!-- map:transform src="stylesheets/html2xhtml.xsl" />
>    <map:transform src="stylesheets/xhtml2fo.xsl" />
>    <map:serialize type="fo2pdf" mime-type="application/pdf" /-->
>  </map:match>
>  
> HTH 
> Holger 
>  
>  
> users-return-81193-holger.willenborg=armacell.com@cocoon.apache.org
> schrieb am 26.07.2005 02:39:25:
> 
>  
>  > Hallo !
>  > I'm a new student of cocoon and i needed to convert a cform to pdf. I
>  > asked help for a friend
>  > who suggested i should read 
>  >
> http://www.mail-archive.com/cocoon-users@xml.apache.org/msg17073.html
>  > where it is suggested to use a double transform to avoid hard xsl 
>  > code writing.
>  > 
>  > Unfortunatly this is not working. I did found some xsl files like the
>  > ones suggested in the example
>  > but i keep running into saxparser exceptions, indicating mis formed
>  > xsl problems.
>  > I believe the problem are the xsl files.
>  > 
>  > If anyone has solved this problem with some xsl files, would it be so
>  > kind to send them, or if they are copyrighted, give some suggestions?
>  > 
>  > Thanks,
>  > M.Thermos
>  > 
>  >
> ---------------------------------------------------------------------
>  > To unsubscribe, e-mail:
> users-unsubscribe@cocoon.apache.org
>  > For additional commands, e-mail: users-help@cocoon.apache.org
>  > 
>  > 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Antwort: html -2- xhtml - 2- xsl - fo

Posted by ho...@armacell.com.
Hi,

I suggest you try to find out where the error occurs using something like 
this:

<map:match pattern="*/**.pdf">
   <map:generate src="xml/{2}.xml"/>
   <map:transform src="stylesheets/{1}.xsl" />
        <!-- Now output the result so far as XML -->
   <map:serialize type="xml"/>

    <!-- comment this out to test only the above -->
   <!-- map:transform src="stylesheets/html2xhtml.xsl" />
   <map:transform src="stylesheets/xhtml2fo.xsl" />
   <map:serialize type="fo2pdf" mime-type="application/pdf" /-->
</map:match>

HTH
Holger


users-return-81193-holger.willenborg=armacell.com@cocoon.apache.org 
schrieb am 26.07.2005 02:39:25:

> Hallo !
> I'm a new student of cocoon and i needed to convert a cform to pdf. I
> asked help for a friend
> who suggested i should read 
> http://www.mail-archive.com/cocoon-users@xml.apache.org/msg17073.html
> where it is suggested to use a double transform to avoid hard xsl 
> code writing.
> 
> Unfortunatly this is not working. I did found some xsl files like the
> ones suggested in the example
> but i keep running into saxparser exceptions, indicating mis formed
> xsl problems.
> I believe the problem are the xsl files.
> 
> If anyone has solved this problem with some xsl files, would it be so
> kind to send them, or if they are copyrighted, give some suggestions?
> 
> Thanks,
> M.Thermos
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
>