You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lionel Crine <cr...@4dconcept.fr> on 2003/02/12 17:40:21 UTC

Too much java in xsp

I'm using an xsp in which I manipulate some code (<xsp:request> parameters, 
for example).

But unfortunately, There is too much code java in it and so the xsp is very 
HUGE.

I was thinking about using an action in the sitemap to modify my document 
instead of java code in the xsp, is it a good idea ?

am I on the right way ?


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Too much java in xsp

Posted by Lionel Crine <cr...@4dconcept.fr>.
Robert,
Here is my issue :

I have create a portal :
When I come to the form page :


1/An xsp file is generated from the form.
2/This xsp get the request parameters and modify the structure as I want it 
to be
3/A transformer Get the SAX events of the xsp generator, get information 
from XML DB and return a response
4/ Finally I dispay the result in the browser.


I think creating a new generator would be an error.


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Too much java in xsp

Posted by Robert Simmons <de...@arcor.de>.
Probably a generator actually. Use generators for things that are more
complex. XSP should be used, IMHO, only for generation with small amounts of
code.

-- Robert

----- Original Message -----
From: "Lionel Crine" <cr...@4dconcept.fr>
To: <co...@xml.apache.org>
Sent: Wednesday, February 12, 2003 5:40 PM
Subject: Too much java in xsp


> I'm using an xsp in which I manipulate some code (<xsp:request> parameters,
> for example).
>
> But unfortunately, There is too much code java in it and so the xsp is very
> HUGE.
>
> I was thinking about using an action in the sitemap to modify my document
> instead of java code in the xsp, is it a good idea ?
>
> am I on the right way ?
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Dynamic XSL evaluation

Posted by Yatin Shah <no...@kripa.com>.
Idhaya, thanks for help. Although the solution is incorrect.
I'll agree with J.Pietschmann, I don't think a simple solution exists!
I think the reasoning is ...
the welcome_title variable is holding a text value and it's not a node set.
text value can not be processed like a node set.

Only hope, I think is with the SQL Transformer. Instead of just laying
the text it should lay the full node set if the sql column value has any 
embeded tags!

-Yatin


J.Pietschmann wrote:

> Idhaya Chandran wrote:
>
>> You can use <xsl:value-of select="{$welcome_title}"/>
>
>
> That's a bad idea. This is a syntax error.
>
>
> >From: Yatin Shah [mailto:nospam@kripa.com]
>
>>> If the welcome_title was "<b> Hello. Welcome to Acme, Inc. &lt;/b&gt;"
>>> Then the embeded HTML code is not interperted as HTML tags.
>>
>
> You should not put HTML snippets into a database. If you
> want to extract them with Cocoon and have them delivered
> as HTML in the output, you'll have to run them through an
> XML parser. Just forget about simple solutions.
>
> J.Pietschmann
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Dynamic XSL evaluation

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Idhaya Chandran wrote:
> You can use 
> <xsl:value-of select="{$welcome_title}"/>

That's a bad idea. This is a syntax error.


 >From: Yatin Shah [mailto:nospam@kripa.com]
>> If the welcome_title was "<b> Hello. Welcome to Acme, Inc. &lt;/b&gt;"
>> Then the embeded HTML code is not interperted as HTML tags.

You should not put HTML snippets into a database. If you
want to extract them with Cocoon and have them delivered
as HTML in the output, you'll have to run them through an
XML parser. Just forget about simple solutions.

J.Pietschmann


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Dynamic XSL evaluation

Posted by Idhaya Chandran <id...@coreobjects.com>.
You can use 
<xsl:value-of select="{$welcome_title}"/>
instead of 
<xsl:value-of select="$welcome_title"/>

--Idhaya
-----Original Message-----
From: Yatin Shah [mailto:nospam@kripa.com]
Sent: Thursday, February 13, 2003 6:09 AM
To: cocoon-users@xml.apache.org
Subject: Dynamic XSL evaluation


My application access DB for content(Using SQL Transformer) which later 
gets transformed into HTML via xml2html transformer.
For example, I have following sniippet in my xml2html transformer:
    <xsl:variable name="welcome_title" 
select="//welcome/sql:rowset/sql:row/sql:title"/>
    <p>
        <xsl:value-of select="$welcome_title"/>
    </p>

This works fine.
If the welcome_title was "<b> Hello. Welcome to Acme, Inc. &lt;/b&gt;"
Then the embeded HTML code is not interperted as HTML tags.
Regardless of how it's embeded in the data(as <b> or as &lt;b&gt;) it is 
included as it was embeded.

What I like to do is to dynamically evaluate the content of 
$welcome_title so that embeded HTML tags are detected and parsed as:
    <p>
        <b>
            Hello. Welcome to Acme, Inc.
        </b>
    </p>

Even better would be to be able to include any XML tags and have it 
dynamically evaluated by the xml2html transformer.
Any one have any ideas?
Thanks for your help.
-Yatin


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Dynamic XSL evaluation

Posted by Yatin Shah <no...@kripa.com>.
My application access DB for content(Using SQL Transformer) which later 
gets transformed into HTML via xml2html transformer.
For example, I have following sniippet in my xml2html transformer:
    <xsl:variable name="welcome_title" 
select="//welcome/sql:rowset/sql:row/sql:title"/>
    <p>
        <xsl:value-of select="$welcome_title"/>
    </p>

This works fine.
If the welcome_title was "<b> Hello. Welcome to Acme, Inc. &lt;/b&gt;"
Then the embeded HTML code is not interperted as HTML tags.
Regardless of how it's embeded in the data(as <b> or as &lt;b&gt;) it is 
included as it was embeded.

What I like to do is to dynamically evaluate the content of 
$welcome_title so that embeded HTML tags are detected and parsed as:
    <p>
        <b>
            Hello. Welcome to Acme, Inc.
        </b>
    </p>

Even better would be to be able to include any XML tags and have it 
dynamically evaluated by the xml2html transformer.
Any one have any ideas?
Thanks for your help.
-Yatin


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Too much java in xsp

Posted by Ray Martin <ra...@aci-hq.com>.
Yes, Sir.  Absolutely use an action and remove JAVA as much as possible from
the xsp.  When you do this and know how to pass a STRING ARRAY into the
XML/XSL without the need of the XSP - please let me know - it is the only
thing that i still rely on an XSP for.

> -----Original Message-----
> From: Lionel Crine [mailto:crine@4dconcept.fr]
> Sent: Wednesday, February 12, 2003 11:40 AM
> To: cocoon-users@xml.apache.org
> Subject: Too much java in xsp
>
>
> I'm using an xsp in which I manipulate some code (<xsp:request>
> parameters,
> for example).
>
> But unfortunately, There is too much code java in it and so the
> xsp is very
> HUGE.
>
> I was thinking about using an action in the sitemap to modify my document
> instead of java code in the xsp, is it a good idea ?
>
> am I on the right way ?
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>
>



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>