You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Schmitt, Christian" <Ch...@Dresdner-Bank.com> on 2000/04/13 19:12:18 UTC

Performance question

Hi,
I've put together a test application where the source xml document calls the
SQL processor. This statement returns about 50 rows with 55 columns. Now I
run the result set thru the XSP processor and do some calculation and
formatting on around 20 columns of each row. I then apply a xsl stylesheet
to output HTML.

Cocoon takes a very long to accomplish that. Most of the time my broweser
times out. But not from the SQL query (this returns in about 5 seconds).
What takes so long, is the XSP stage.

Am I doing something wrong here, or is XSP not intended to work on that kind
of data?


Thanks for any info.

Christian Schmitt

Re: XSLT questions.

Posted by Stefano Mazzocchi <st...@apache.org>.
Ulrich Mayring wrote:
> 
> Stefano Mazzocchi wrote:
> >
> > Since we are in the middle of a big shift between the 1.7 and 2.0 tree,
> > we don't want to waste time writing docs that we'll be throwing away in
> > a couple of months.
> 
> A couple of months? Is that a promise? ;-)

Beta for June, we said.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------

Re: XSLT questions.

Posted by Ulrich Mayring <ul...@denic.de>.
Stefano Mazzocchi wrote:
> 
> Since we are in the middle of a big shift between the 1.7 and 2.0 tree,
> we don't want to waste time writing docs that we'll be throwing away in
> a couple of months.

A couple of months? Is that a promise? ;-)

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: XSLT questions.

Posted by Stefano Mazzocchi <st...@apache.org>.
Sebastien Koechlin I-VISION wrote:
> 
> Peter Kharchenko wrote :
> 
> >   I have a couple of rather basic questions on associating XSLT stylesheets with XML
> > documents. I've read the w3c recommendation on that subject
> > (http://www.w3.org/1999/06/REC-xml-stylesheet-19990629/), but couldn't find an
> > answer. I hope one of you guys can help me out.
> 
> I did not find any good documentation about XSLT. It's really painful.
> (And it's the same for XSP and taglib, Cocoon is an hard way !)

Since we are in the middle of a big shift between the 1.7 and 2.0 tree,
we don't want to waste time writing docs that we'll be throwing away in
a couple of months.

Anyway, never said learning Cocoon was easy :)

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Re: XSLT questions.

Posted by Sebastien Koechlin I-VISION <sk...@n-soft.com>.
Peter Kharchenko wrote :

>   I have a couple of rather basic questions on associating XSLT stylesheets with XML
> documents. I've read the w3c recommendation on that subject
> (http://www.w3.org/1999/06/REC-xml-stylesheet-19990629/), but couldn't find an
> answer. I hope one of you guys can help me out.

I did not find any good documentation about XSLT. It's really painful. 
(And it's the same for XSP and taglib, Cocoon is an hard way !)

>  I was wondering if it's possible to associate stylesheet with a particular XML node
> instead of a whole document. For example if I have the following document,
> --------------------
> <book>
>   <index> ... </index>
>   <chapter> ... </chapter>
>   <chapter> ... </chapter>
> </book>
> --------------------
>  I would like to associate a different stylesheet with each of the <chapter> nodes
> (because chapters might differ in their formats).

You can associate a template with a particular element using XPath using
something
like :

<xsl:template match="book">
	(...)
		<xsl:apply-templates select="index">
		<xsl:apply-templates select="chapter[1]" mode="style1" />
		<xsl:apply-templates select="chapter[2]" mode="style2" />
	(...)
</xsl:template>

<xsl:template match="chapter" mode="style1">
	(...)
</xsl:template>

<xsl:template match="chapter" mode="style2">
	(...)
</xsl:template>

With XPath, you can select a particular chapter, on it's position (for
example every other
chapter), or on an chapter attribute (better), using
select="chapter[@style='value']"

-- 
Seb

Re: XSLT questions.

Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 17 Apr 2000, Peter Kharchenko wrote:

> Second question is somewhat similar. I would like to have an XML
> document that includes other XML documents. Does cocoon support
> Xinclude syntax (<xinclude:include href="other.xml"/>) ? And, if so,
> how are the XSLT transformations performed ? If "other.xml" specifies
> its own stylesheet, will it be processed prior to stylesheets
> specified in the main document ?

Not in cocoon 1, only in cocoon2.

- donald


XSLT questions.

Posted by Peter Kharchenko <pe...@interactivebusiness.com>.
Hi there,
  I have a couple of rather basic questions on associating XSLT stylesheets with XML
documents. I've read the w3c recommendation on that subject
(http://www.w3.org/1999/06/REC-xml-stylesheet-19990629/), but couldn't find an
answer. I hope one of you guys can help me out.

 I was wondering if it's possible to associate stylesheet with a particular XML node
instead of a whole document. For example if I have the following document,
--------------------
<book>
  <index> ... </index>
  <chapter> ... </chapter>
  <chapter> ... </chapter>
</book>
--------------------
 I would like to associate a different stylesheet with each of the <chapter> nodes
(because chapters might differ in their formats).
In java, there's a straightforward way of applying a stylesheet to a DOM tree
specified by a particular node, such as a <chapter> element, however I do not know a
way of creating an XML processing instruction to do that. Is there a way to do that,
or are we restricted to specifying stylesheet binding only to the entire document ?

Second question is somewhat similar. I would like to have an XML document that
includes other XML documents. Does cocoon support Xinclude syntax (<xinclude:include
href="other.xml"/>) ? And, if so, how are the XSLT transformations performed ? If
"other.xml" specifies its own stylesheet, will it be processed prior to stylesheets
specified in the main document ?

Sorry if my questions are very basic. If the answers are obvious, please point me an
example I can look at :)

Thanks,
-peter.


Re: Performance question

Posted by Berin Loritsch <bl...@infoplanning.com>.
XSP pages have to compile the first time through, and that is probably what is
happening.  Was the delay the same for each additional time you accessed the
URL?  For instance, Stefano's presentation took 45 seconds to access from my
own machine the first time (I have a 700 MHz Athlon and 256 MB RAM), but
each additional page rendered in 350-550 milliseconds (I have logging on).

The major problem I have with XSP is similar to the major problem with IIS/
ColdFusion: there are problems with the first access.  XSP takes time to compile

(to be fair, so does JSP), but that is livable.  IIS/ColdFusion ALWAYS returns
a 500 Server Error on the first access, but is OK each additional access (that
is
not acceptable).  If Cocoon can compile the XSP pages ahead of time, that would
be killer.  Otherwise, write a script to call every XSP page you have and get it

compiled before you have any traffic.

"Schmitt, Christian" wrote:

> Hi,
> I've put together a test application where the source xml document calls the
> SQL processor. This statement returns about 50 rows with 55 columns. Now I
> run the result set thru the XSP processor and do some calculation and
> formatting on around 20 columns of each row. I then apply a xsl stylesheet
> to output HTML.
>
> Cocoon takes a very long to accomplish that. Most of the time my broweser
> times out. But not from the SQL query (this returns in about 5 seconds).
> What takes so long, is the XSP stage.
>
> Am I doing something wrong here, or is XSP not intended to work on that kind
> of data?
>
> Thanks for any info.
>
> Christian Schmitt
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Performance question

Posted by Donald Ball <ba...@webslingerZ.com>.
On Thu, 13 Apr 2000, Schmitt, Christian wrote:

> Hi,
> I've put together a test application where the source xml document calls the
> SQL processor. This statement returns about 50 rows with 55 columns. Now I
> run the result set thru the XSP processor and do some calculation and
> formatting on around 20 columns of each row. I then apply a xsl stylesheet
> to output HTML.
> 
> Cocoon takes a very long to accomplish that. Most of the time my broweser
> times out. But not from the SQL query (this returns in about 5 seconds).
> What takes so long, is the XSP stage.
> 
> Am I doing something wrong here, or is XSP not intended to work on that kind
> of data?

you might want to use the sql xsp taglib instead - that should eliminate
the need to recompile the xsp page each time, which i fear is the case
here...

- donald