Re: DEFINITELY A BUG.. Re: Cocoon FAILS in transforming XML

2002-10-11 Thread Roger Ting
] 
(/cocoon/report) HttpProcessor[8080][4]/monthly_xsp: esql query:   
select count(*) as denominator  from VITAL.Patient   where   
date_add(2002-9-01,  interval 23 day)discharge_date
DEBUG   (2002-10-10) 05:44.06:430   [sitemap.generator.serverpages] 
(/cocoon/report) HttpProcessor[8080][4]/monthly_xsp: esql query:  select 
count(*) as numerator from VITAL.Fall where  
month(fall_date)=9  and year(fall_date)=2002 and 
dayofmonth(fall_date)=25
DEBUG   (2002-10-10) 05:44.06:600   [sitemap.generator.serverpages] 
(/cocoon/report) HttpProcessor[8080][4]/monthly_xsp: esql query:   
select count(*) as denominator  from VITAL.Patient   where   
date_add(2002-9-01,  interval 24 day)discharge_date
DEBUG   (2002-10-10) 05:44.06:710   [sitemap.generator.serverpages] 
(/cocoon/report) HttpProcessor[8080][4]/monthly_xsp: esql query:  select 
count(*) as numerator from VITAL.Fall where  
month(fall_date)=9  and year(fall_date)=2002 and 
dayofmonth(fall_date)=26
DEBUG   (2002-10-10) 05:44.06:870   [sitemap.generator.serverpages] 
(/cocoon/report) HttpProcessor[8080][4]/monthly_xsp: esql query:   
select count(*) as denominator  from VITAL.Patient   where   
date_add(2002-9-01,  interval 25 day)discharge_date
DEBUG   (2002-10-10) 05:44.07:040   [sitemap.generator.serverpages] 
(/cocoon/report) HttpProcessor[8080][4]/monthly_xsp: esql query:  select 
count(*) as numerator from VITAL.Fall where  
month(fall_date)=9  and year(fall_date)=2002 and 
dayofmonth(fall_date)=27
DEBUG   (2002-10-10) 05:44.07:200   [sitemap.generator.serverpages] 
(/cocoon/report) HttpProcessor[8080][4]/monthly_xsp: esql query:   
select count(*) as denominator  from VITAL.Patient   where   
date_add(2002-9-01,  interval 26 day)discharge_date
DEBUG   (2002-10-10) 05:44.07:370   [sitemap.generator.serverpages] 
(/cocoon/report) HttpProcessor[8080][4]/monthly_xsp: esql query:  select 
count(*) as numerator from VITAL.Fall where  
month(fall_date)=9  and year(fall_date)=2002 and 
dayofmonth(fall_date)=28
DEBUG   (2002-10-10) 05:44.07:530   [sitemap.generator.serverpages] 
(/cocoon/report) HttpProcessor[8080][4]/monthly_xsp: esql query:   
select count(*) as denominator  from VITAL.Patient   where   
date_add(2002-9-01,  interval 27 day)discharge_date
DEBUG   (2002-10-10) 05:44.07:700   [sitemap.generator.serverpages] 
(/cocoon/report) HttpProcessor[8080][4]/monthly_xsp: esql query:  select 
count(*) as numerator from VITAL.Fall where  
month(fall_date)=9  and year(fall_date)=2002 and 
dayofmonth(fall_date)=29
DEBUG   (2002-10-10) 05:44.07:860   [sitemap.generator.serverpages] 
(/cocoon/report) HttpProcessor[8080][4]/monthly_xsp: esql query:   
select count(*) as denominator  from VITAL.Patient   where   
date_add(2002-9-01,  interval 28 day)discharge_date
DEBUG   (2002-10-10) 05:44.08:030   [sitemap.generator.serverpages] 
(/cocoon/report) HttpProcessor[8080][4]/monthly_xsp: esql query:  select 
count(*) as numerator from VITAL.Fall where  
month(fall_date)=9  and year(fall_date)=2002 and 
dayofmonth(fall_date)=30
DEBUG   (2002-10-10) 05:44.08:190   [sitemap.generator.serverpages] 
(/cocoon/report) HttpProcessor[8080][4]/monthly_xsp: esql query:   
select count(*) as denominator  from VITAL.Patient   where   
date_add(2002-9-01,  interval 29 day)discharge_date


HERE ARE MY SITEMAP DECLARATION
map:match pattern=monthly type=wildcard-request-parameter
map:generate 
type=xsp src=Xsp/monthly.xsp/
map:transform 
type=xslt src=Xsl/monthly_fall.xsl/
map:serialize 
type=xml/
/map:match

No error message etc, it just drop the output for drawing bar and tex
as shown on the XSLT below.

XSP-XML SAVED-XSLT - OUTPUT works

XSP-XSLT-OUTPUT doesn't works




From: Geoff Howard [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: DEFINITELY A BUG.. Re: Cocoon FAILS in transforming XML Date: 
Thu, 10 Oct 2002 12:53:03 -0700 (PDT)

I haven't followed your this whole thread, but I think
I've had similar problems that turned out to be
related to namespaces.  Are there any namespaces
declared in your XSP that are not declared in your
XSLT (whether they are used in the output or not)?  If
so, try declaring them in the xslt.  I never looked at
the problem carefully enough to determine whether it
was cocoon not handling things properly, or whether it
was just sloppy handling of namespaces on my part, but
that has fixed

DEFINITELY A BUG.. Re: Cocoon FAILS in transforming XML

2002-10-10 Thread Roger Ting

Hi thx for your response.

The funny thing is below
What works:
1. i read the XSP that uses ESQL with serverpages generator it will generate 
the xml file.
2. I save the xml file generated using the the XSP.
3. Do transformation with Xalan or Saxon (Tried both) and the output
is correct.

What doesn't works:
1. I read the same XSP.
2. pipe it into a XSLT transformer.
3. Serialize it in SVG or XML.
4. 60% of the output is gone.

2 processes are the same except for the first i save it before i transform 
and serialize the xml file generated from the XSP with ESQL.
The second process i pipe the output from XSP directly into the XSLT
transformer and it drop most of the output. Another user also faces
the same problem. We are using 2 different computers.

===HERE IS MY XSLT =
?xml version=1.0 encoding=UTF-8?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:icr=http://www.cs.mu.oz.au/340/s340gf;
xmlns:svg=http://www.w3.org/2000/svg;

xsl:output method=xml indent=yes/
xsl:template match=icr:report
svg width=300 height=300 
titleThe graphs for the dailyly section /title
g transform=translate(100, 100)
xsl:apply-templates select=icr:fall/
/g
/svg
/xsl:template

xsl:template match=icr:fall
g transform= translate(-20,-80) scale(2,2)
text 
xsl:attribute name=font-size
xsl:value-of select=6 /
/xsl:attribute
Patient falls record
/text
/g

g transform=translate(0,100) scale(2,-2) 
!--drawing the axes--
   line x1=0 y1=0 x2=140 y2=0 style=stroke: black;/
   line x1=0 y1=0 x2=0 y2=80 style=stroke: black;/
/g

 !--- Doesn't transform from here onwards ---
xsl:for-each select=icr:monthly
xsl:call-template name=draw-bar 
xsl:with-param name=n select=@numerator/
xsl:with-param name=d select=@denominator/
xsl:with-param name=count select=position()/
xsl:with-param name=threshold select=@threshold/
xsl:with-param name=next 
select=following-sibling::icr:monthly/attribute::numerator/
xsl:with-param name=last select=count(icr:monthly)/
/xsl:call-template
xsl:call-template name=write-text 
xsl:with-param name=count select=position()/
/xsl:call-template
/xsl:for-each

/xsl:template

xsl:template name=draw-bar
xsl:param name=n/
xsl:param name=d/
xsl:param name=count/
xsl:param name=threshold/
xsl:param name=next/
xsl:param name=last/


g transform=translate(0,100) scale(2,-2) 
!-- these are the bars in order --
rect style=fill:none; stroke:black; stroke-width=1
xsl:attribute name=y
0
/xsl:attribute
xsl:attribute name=x
xsl:value-of select=$count*5/
/xsl:attribute
xsl:attribute name=width
5
/xsl:attribute
xsl:attribute name=height
xsl:value-of select=20*($n div $d) /
/xsl:attribute
/rect

rect style=fill:red;stroke:red;
xsl:attribute name=y
xsl:value-of select=$threshold/
/xsl:attribute
xsl:attribute name=x
xsl:value-of select=$count*5+1/
/xsl:attribute
xsl:attribute name=width
2
/xsl:attribute
xsl:attribute name=height
2
/xsl:attribute
/rect

rect style=fill:blue;stroke:blue;
xsl:attribute name=yxsl:value-of 
select=$n*10//xsl:attribute
xsl:attribute name=xxsl:value-of 
select=$count*5+1//xsl:attribute
xsl:attribute name=width
2
/xsl:attribute

Re: DEFINITELY A BUG.. Re: Cocoon FAILS in transforming XML

2002-10-10 Thread Geoff Howard

I haven't followed your this whole thread, but I think
I've had similar problems that turned out to be
related to namespaces.  Are there any namespaces
declared in your XSP that are not declared in your
XSLT (whether they are used in the output or not)?  If
so, try declaring them in the xslt.  I never looked at
the problem carefully enough to determine whether it
was cocoon not handling things properly, or whether it
was just sloppy handling of namespaces on my part, but
that has fixed a similar problem for me in the past.

Geoff Howard


--- Roger Ting [EMAIL PROTECTED] wrote:
 Hi thx for your response.
 
 The funny thing is below
 What works:
 1. i read the XSP that uses ESQL with serverpages
 generator it will generate 
 the xml file.
 2. I save the xml file generated using the the XSP.
 3. Do transformation with Xalan or Saxon (Tried
 both) and the output
 is correct.
 
 What doesn't works:
 1. I read the same XSP.
 2. pipe it into a XSLT transformer.
 3. Serialize it in SVG or XML.
 4. 60% of the output is gone.
 
 2 processes are the same except for the first i save
 it before i transform 
 and serialize the xml file generated from the XSP
 with ESQL.
 The second process i pipe the output from XSP
 directly into the XSLT
 transformer and it drop most of the output. Another
 user also faces
 the same problem. We are using 2 different
 computers.
 
 ===HERE IS MY XSLT
 =
 ?xml version=1.0 encoding=UTF-8?
 xsl:stylesheet version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:icr=http://www.cs.mu.oz.au/340/s340gf;
 xmlns:svg=http://www.w3.org/2000/svg;
 
 xsl:output method=xml indent=yes/
 xsl:template match=icr:report
 svg width=300 height=300 
   titleThe graphs for the dailyly section /title
   g transform=translate(100, 100)
   xsl:apply-templates select=icr:fall/
   /g
 /svg
 /xsl:template
 
 xsl:template match=icr:fall
   g transform= translate(-20,-80) scale(2,2)
   text 
   xsl:attribute name=font-size
   xsl:value-of select=6 /
   /xsl:attribute
   Patient falls record
   /text
   /g
 
   g transform=translate(0,100) scale(2,-2) 
   !--drawing the axes--
  line x1=0 y1=0 x2=140 y2=0
 style=stroke: black;/
  line x1=0 y1=0 x2=0 y2=80
 style=stroke: black;/
   /g
 
  !--- Doesn't transform from here onwards
 ---
   xsl:for-each select=icr:monthly
   xsl:call-template name=draw-bar 
   xsl:with-param name=n select=@numerator/
   xsl:with-param name=d select=@denominator/
   xsl:with-param name=count
 select=position()/
   xsl:with-param name=threshold
 select=@threshold/
   xsl:with-param name=next 

select=following-sibling::icr:monthly/attribute::numerator/
   xsl:with-param name=last
 select=count(icr:monthly)/
   /xsl:call-template
   xsl:call-template name=write-text 
   xsl:with-param name=count
 select=position()/
   /xsl:call-template
   /xsl:for-each
 
 /xsl:template
 
 xsl:template name=draw-bar
   xsl:param name=n/
   xsl:param name=d/
   xsl:param name=count/
   xsl:param name=threshold/
   xsl:param name=next/
   xsl:param name=last/
 
 
   g transform=translate(0,100) scale(2,-2) 
   !-- these are the bars in order --
   rect style=fill:none; stroke:black;
 stroke-width=1
   xsl:attribute name=y
   0
   /xsl:attribute
   xsl:attribute name=x
   xsl:value-of select=$count*5/
   /xsl:attribute
   xsl:attribute name=width
   5
   /xsl:attribute
   xsl:attribute name=height
   xsl:value-of select=20*($n div $d) /
   /xsl:attribute
   /rect
 
   rect style=fill:red;stroke:red;
   xsl:attribute name=y
   xsl:value-of select=$threshold/
   /xsl:attribute
   xsl:attribute name=x
   xsl:value-of select=$count*5+1/
   /xsl:attribute
   xsl:attribute name=width
   2
   /xsl:attribute