Re: speeding up svg serialization?

2002-10-09 Thread lrs

Hi Joerg,

From: Joerg Heinicke [EMAIL PROTECTED]
 Hello Leona,

 we use SVG generated PNGs at www.ekommunen.de too and the serialization
 is really fast except the very first request on a SVG serializer. I
 guess this is because of the first instantiation of Batik, but maybe
 somebody can say something more about this. Is it really a problem if
 the very first user accessing the very first time the site has to wait
 some seconds more?

It wouldn't be so bad if it was just the first user, but in our
architecture,
every user is running Tomcat and Cocoon, thus every user is also a
first user! I'll have to do some research on Batik, but hints would be
welcome.

 Maybe therefore you can optimize your sitemap or the XSLT. For example
 you are passing the request parameters and some other parameters to the
 stylesheets, which prevents effective caching. Stylesheets are cached in
 combination with passed parameters. We changed this by storing such
 parameters in an extra XML, which is aggregated in the sitemap. So there
 is really only one instance of the stylesheet in the cache.

Are you talking about storing the parameters in an XML file? What I
think I really need is the concept of a session object that can pass
parameters between pages.

 Furthermore I see

 add_image
 img_file={concat('http://localhost:8080/GS/name.jpg?display=',
./Role)}/

 in the stylesheets, which can be simplified to

 add_image img_file=http://localhost:8080/GS/name.jpg?display={Role}/

This was a beginners mistake which has been fixed.

 And the third point: You have a template creating an add_image/
 element and one matching one them. Hmm, I can only guess, but are you
 storing add_image/ in a Result Tree Fragment, which you convert back
 to a node set and apply a template to it? If it is so, maybe there are
 better processings possible.


add_image/ generates the HTML output which goes to the serializer.

In general the Cocoon/XML/Java parts perform well. I am new to Cocoon,
so, of course, there is room for improvement, but it really is the svg
processing
that slows it down the first time.

 Regards,

 Joerg

Thanks for your help,
Leona

 lrs wrote:
  Hi All,
 
  I have an application that is generating some labels for a table
  using svg. All it does is generate some text and rotate it 180.
  This is the sitemap fragement that applies to this function.
 
 map:match pattern=name.jpg
   map:generate src=gs.xml/
  map:transform src=page2svg.xsl
map:parameter name=use-request-parameters value=true/
map:parameter name=pagename value=name.jpg/
map:parameter name=display value={display}/
  /map:transform
   map:serialize type=svg2jpeg/
 /map:match
 
  which is called from this piece of XSL.
xsl:template match=Role name=Role
   ...
  add_image
  img_file={concat('http://localhost:8080/GS/name.jpg?display=',
./Role)}/
  ...
/xsl:template
 
  and add_image is a simple template:
 
xsl:template name=add_image match=add_image
  xsl:element name=img
xsl:attribute name=src
  xsl:value-of select=@img_file/
/xsl:attribute
  /xsl:element
/xsl:template
 
  The problem is that the rendering of the svg is sooo slow. It takes
  up to 15 seconds to generate as few a 8 labels, whereas the table
  itself (plain HTML) can have hundreds of cells, yet render in as
  little as 2 seconds. Subsequent views of the page are faster
  because the images are cached, but I would like to get better
  performance on the first viewing.
 
  Does anyone know if this can be optimized, either in the configuration
  files, the sitemap, the XSL or some other method?
 
  Any help would be greatly appreciated.
 
  Thanks very much,
  Leona Slepetis


 -
 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: [EMAIL PROTECTED]
 For additional commands, e-mail:   [EMAIL PROTECTED]





-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




speeding up svg serialization?

2002-10-08 Thread lrs

Hi All,

I have an application that is generating some labels for a table
using svg. All it does is generate some text and rotate it 180.
This is the sitemap fragement that applies to this function.

   map:match pattern=name.jpg
 map:generate src=gs.xml/
map:transform src=page2svg.xsl
  map:parameter name=use-request-parameters value=true/
  map:parameter name=pagename value=name.jpg/
  map:parameter name=display value={display}/
/map:transform
 map:serialize type=svg2jpeg/
   /map:match

which is called from this piece of XSL.
  xsl:template match=Role name=Role
 ...
add_image
img_file={concat('http://localhost:8080/GS/name.jpg?display=', ./Role)}/
...
  /xsl:template

and add_image is a simple template:

  xsl:template name=add_image match=add_image
xsl:element name=img
  xsl:attribute name=src
xsl:value-of select=@img_file/
  /xsl:attribute
/xsl:element
  /xsl:template

The problem is that the rendering of the svg is sooo slow. It takes
up to 15 seconds to generate as few a 8 labels, whereas the table
itself (plain HTML) can have hundreds of cells, yet render in as
little as 2 seconds. Subsequent views of the page are faster
because the images are cached, but I would like to get better
performance on the first viewing.

Does anyone know if this can be optimized, either in the configuration
files, the sitemap, the XSL or some other method?

Any help would be greatly appreciated.

Thanks very much,
Leona Slepetis
[EMAIL PROTECTED]




-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




converting from document() to cinclude

2002-09-30 Thread lrs

Hi all,

I am trying to pull data from various XML files, using
cinclude, and I just seem to be missing something obvious.
I went through the list archives, but my problem seems
to be much simpler than what I found there.

I have been using the XSL document() function to get
a value from the files, but realize that this is not
the way to do it.

Here's what I want to do:
1. get a value for the root path of my application from
one XML file
2. assign it to a param or otherwise keep track of it
for further use.

Starting with the first page of my sitemap, I have:

  map:match pattern=gs
map:generate src=gs.xml/
map:transform src=gs.xsl/
map:transform src=default-html.xsl/
map:serialize type=html/
  /map:match

gs.xml contains basic application data.

The major business logic transformations take place in
gs.xsl.  This is what I currently am doing with document() in gs.xsl:

?xml version=1.0 encoding=UTF-8?
xsl:stylesheet version=1.0
  xmlns:saxon=http://icl.com/saxon;
  xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
  

  xsl:strip-space elements=*/
  !-- get the root path for other XML and gif files --
  xsl:param name=root 
select=document('../../dat/gsproperties.xml')//Root/
...
with many references to $root.


default-html.xsl contains more transformations that are rather
straighforward, but it uses $root in some places.


and gsproperties.xml contains:

Properties
  RootD:/tomcat//Root
  Project kgID=1001
TargetDate3/2/02/TargetDate
  /Project
/Properties



I seem to be doing something wrong with the syntax when I try to use 
cinclude
instead of document().
The errors typically say something like file:/dat/gsproperties.xml was 
not found.
I have tried various versions of examples from the archives, with no 
success.

Am I going about this in a completely wrong manner?

Regards,
Leona Slepetis
[EMAIL PROTECTED]





-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]