You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Ugo Cei <ug...@apache.org> on 2005/07/12 10:59:11 UTC
[CForms] Stylesheets incompatible with Saxon 8
Dear Cocooners,
I've started using Saxon8 instead of Xalan for all my Cocoon
applications but it seems I've hit a snag when it comes to displaying
forms. Looks like Saxon doesn't like the CForms stylesheets because the
"resources-uri" variable is declared multiple times. Indeed, it is
declared in more than one XSL file, which are in turn included by
forms-samples-styling.xsl.
Now, I don't know if Saxon is right in being so picky, but knowing
Micheal Kay a little, I wouldn't bet against him when it comes to
standards compliance ;).
What I did locally is to remove the declaration from all the included
files and move it to forms-samples-styling only. I did a quick tour of
the forms samples (using Xalan) and they all seem to still work.
Unless there's some serious objection, I'm going to commit this fix
soon. We can always revert, in any case.
Ugo
--
Ugo Cei
Tech Blog: http://agylen.com/
Open Source Zone: http://oszone.org/
Wine & Food Blog: http://www.divinocibo.it/
Re: [CForms] Stylesheets incompatible with Saxon 8
Posted by Antonio Fiol Bonnín <an...@gmail.com>.
>
> > 2) we keep the change and we advise people to use a wrapper
> > stylesheet that declares the parameter
>
> ... not ideal. I don't know how many people use individual
> stylesheets directly, but I suspect it's quite a few.
>
Hi,
I'd suggest keeping the change, creating different XSL files, and providing
the wrapper stylesheets in files with the same names the real ones used to
have. This way, it would be backwards compatible and the problem would be
fixed.
--
Antonio
Re: [CForms] Stylesheets incompatible with Saxon 8
Posted by Andrew Savory <an...@luminas.co.uk>.
Hi,
On 20 Jul 2005, at 15:25, Ugo Cei wrote:
> I see three possibilities here:
>
> 1) we revert the change and whoever uses Saxon must be warned that
> they have to ""fix" stylesheets locally.
... not ideal.
> 2) we keep the change and we advise people to use a wrapper
> stylesheet that declares the parameter
... not ideal. I don't know how many people use individual
stylesheets directly, but I suspect it's quite a few.
> 3) we solve the include/import issue once and for all
... there's never a simple solution is there? :-)
I'll take a look at the include/import issue and see if I can work
out what's up.
Cheers,
Andrew.
--
Andrew Savory, Managing Director, Luminas Limited
Tel: +44 (0)870 741 6658 Fax: +44 (0)700 598 1135
Web: http://www.luminas.co.uk/
Orixo alliance: http://www.orixo.com/
Re: [CForms] Stylesheets incompatible with Saxon 8
Posted by Ugo Cei <ug...@apache.org>.
Il giorno 20/lug/05, alle 16:13, Andrew Savory ha scritto:
> Can we revert this change until a better (or more backward-compatible)
> way of handling it is devised?
I see three possibilities here:
1) we revert the change and whoever uses Saxon must be warned that they
have to ""fix" stylesheets locally.
2) we keep the change and we advise people to use a wrapper stylesheet
that declares the parameter
3) we solve the include/import issue once and for all
Obviously #3 is preferrable but I'm not sure I am able to fix it soon.
In the meantime, I think going for #2 is better. Writing a wrapper
stylesheet is certainly less work than using locally modified copies of
all the stylesheets that are now in the JAR file.
WDYT?
Ugo
--
Ugo Cei
Tech Blog: http://agylen.com/
Open Source Zone: http://oszone.org/
Wine & Food Blog: http://www.divinocibo.it/
Re: [CForms] Stylesheets incompatible with Saxon 8
Posted by Andrew Savory <an...@luminas.co.uk>.
Hi,
On 12 Jul 2005, at 09:59, Ugo Cei wrote:
> What I did locally is to remove the declaration from all the
> included files and move it to forms-samples-styling only. I did a
> quick tour of the forms samples (using Xalan) and they all seem to
> still work.
>
> Unless there's some serious objection, I'm going to commit this fix
> soon. We can always revert, in any case.
Re: svn commit: r215954 - in /cocoon/branches/BRANCH_2_1_X/src/blocks/
forms: java/org/apache/cocoon/forms/resources/
- <xsl:param name="resources-uri">resources</xsl:param>
.... ouch! :-(
This breaks any site that makes use of any of the individual cforms
styling xslt on their own.
Can we revert this change until a better (or more backward-
compatible) way of handling it is devised?
Or do we just accept that cforms is unstable, in which case we need
to warn everyone that this has happened, and the likely errors they
are going to get (javax.xml.transform.TransformerException: Could not
find variable with the name of resources-uri).
Andrew.
--
Andrew Savory, Managing Director, Luminas Limited
Tel: +44 (0)870 741 6658 Fax: +44 (0)700 598 1135
Web: http://www.luminas.co.uk/
Orixo alliance: http://www.orixo.com/
Re: [CForms] Stylesheets incompatible with Saxon 8
Posted by Reinhard Poetz <re...@apache.org>.
Joerg Heinicke wrote:
> On 12.07.2005 17:42, Jason Johnston wrote:
>
>>>> It works. The only nagging doubt I have is whether removing the
>>>> parameter declaration from the included files means that they cannot
>>>> be used anymore by themselves. I doubt anyone is doing this, however.
>>>
>>>
>>> I'm doing this :-) As the name says, it's forms-*samples*-styling and
>>> it has nothing to do with my application.
>>
>>
>>
>> I am doing this as well; in fact I'm only using forms-field-styling.xsl
>> not imported by anything else. So removing that variable declaration
>> will break the individual stylesheets when used alone. Authors
>> shouldn't have to create a stylesheet that does nothing but include
>> another single stylesheet and declare a single variable.
I'm doing more than those two imports in my stylesheet. As the default templates
don't fit my needs completly, I override them and use <xsl:apply-imports/> which
makes the whole system very flexible.
> The way you and Reinhard are using it is the way I planned and
> implemented it. Unfortunately it is not standard compliant as shown not
> only by Saxon, but also by XSLTC. There were complaints about it, but I
> never fixed for the reason you wrote above. Now that it is changed, I
> won't revert it though ;-)
>
>>> In my cforms2html.xsl stylesheet I have imported the general
>>> stylesheets:
>>>
>>> <xsl:import
>>> href="resource://org/apache/cocoon/forms/resources/forms-page-styling.xsl"/>
>>>
>>> <xsl:import
>>> href="resource://org/apache/cocoon/forms/resources/forms-field-styling.xsl"/>
>>>
>>>
>>> But this shouldn't stop you from fixing the bug as I can set the
>>> parameter in my cforms2html.xsl stylesheet.
>>>
>>> IIRC the forms-*samples*-styling.xsl stylesheet includes the
>>> sub-stylesheets instead of importing them. If you are at it, maybe
>>> you can fix this too.
>
>
> This was also with intent. Somewhere in the files it is explained.
Do you recall the reason why you included the stylesheets instead of importing them?
I found
<!--+ Include styling stylesheets, one for the widgets, the other one for the
| page. As 'forms-advanced-field-styling.xsl' is a specialization of
| 'forms-field-styling.xsl' the latter one is imported there. If you don't
| want advanced styling of widgets, change it here!
| See xsl:include as composition and xsl:import as extension/inheritance.
+-->
but this doesn't answer my questions (completly).
>
>> Actually, IIUC, changing from xsl:include to xsl:import would fix the
>> issue with the duplicate variable declarations anyway, since xsl:import
>> allows for overriding of variables/params/templates while xsl:include
>> does not. I am unable to verify that right now though.
>
>
> This would break my analogy from the comment/explanation mentioned
> above, but if the XSLT spec is that stupid and if it would help to solve
> the issue, I can live with it too :-)
--
Reinhard Pötz Independent Consultant, Trainer & (IT)-Coach
{Software Engineering, Open Source, Web Applications, Apache Cocoon}
web(log): http://www.poetz.cc
--------------------------------------------------------------------
Re: [CForms] Stylesheets incompatible with Saxon 8
Posted by Peter Hunsberger <pe...@gmail.com>.
On 7/12/05, Ugo Cei <ug...@apache.org> wrote:
<snip/>
>
> I tried changing includes to imports in forms-samples-styling.xsl but
> this breaks the samples. I couldn't spot where the difference was
> between the two outputs, but the layout of the form1 sample is wrong
> and tabs disappeared.
That's going to be due to the results of the differences between
apply-templates and apply-imports. Somewhere the former needs to be
changed to the latter. If you've got access to Stylus Studio it will
identify these spots pretty quickly: run the current stylesheets,
select the resultant output and examine the back trace up through the
template invocation order. (Other tools may also provide similar
capabilities.)
Alternatively, you may be able to spot these by eye, just by examining
the importing stylesheet for locations where it does an
apply-templates and there is no obvious candidate target in the
current stylesheet....
<snip/>
--
Peter Hunsberger
Re: [CForms] Stylesheets incompatible with Saxon 8
Posted by Ugo Cei <ug...@apache.org>.
Il giorno 12/lug/05, alle 19:22, Joerg Heinicke ha scritto:
> On 12.07.2005 17:42, Jason Johnston wrote:
>
>>>> It works. The only nagging doubt I have is whether removing the
>>>> parameter declaration from the included files means that they
>>>> cannot be used anymore by themselves. I doubt anyone is doing this,
>>>> however.
>>>
>>> I'm doing this :-) As the name says, it's forms-*samples*-styling
>>> and it has nothing to do with my application.
>> I am doing this as well; in fact I'm only using
>> forms-field-styling.xsl
>> not imported by anything else. So removing that variable declaration
>> will break the individual stylesheets when used alone. Authors
>> shouldn't have to create a stylesheet that does nothing but include
>> another single stylesheet and declare a single variable.
>
> The way you and Reinhard are using it is the way I planned and
> implemented it. Unfortunately it is not standard compliant as shown
> not only by Saxon, but also by XSLTC. There were complaints about it,
> but I never fixed for the reason you wrote above. Now that it is
> changed, I won't revert it though ;-)
I tried changing includes to imports in forms-samples-styling.xsl but
this breaks the samples. I couldn't spot where the difference was
between the two outputs, but the layout of the form1 sample is wrong
and tabs disappeared.
Now, if someone who is better than me at XSL-T wants to submit a patch
that makes the stylesheets compliant with the spec and working with
most processors, while allowing to use one of them in isolation, I'd be
glad to test it and apply it. Just don't expect me to do it :)
Ugo
--
Ugo Cei
Tech Blog: http://agylen.com/
Open Source Zone: http://oszone.org/
Wine & Food Blog: http://www.divinocibo.it/
Re: [CForms] Stylesheets incompatible with Saxon 8
Posted by Joerg Heinicke <jo...@gmx.de>.
On 12.07.2005 17:42, Jason Johnston wrote:
>>>It works. The only nagging doubt I have is whether removing the
>>>parameter declaration from the included files means that they cannot be
>>>used anymore by themselves. I doubt anyone is doing this, however.
>>
>>I'm doing this :-) As the name says, it's forms-*samples*-styling and it has
>>nothing to do with my application.
>
>
> I am doing this as well; in fact I'm only using forms-field-styling.xsl
> not imported by anything else. So removing that variable declaration
> will break the individual stylesheets when used alone. Authors
> shouldn't have to create a stylesheet that does nothing but include
> another single stylesheet and declare a single variable.
The way you and Reinhard are using it is the way I planned and
implemented it. Unfortunately it is not standard compliant as shown not
only by Saxon, but also by XSLTC. There were complaints about it, but I
never fixed for the reason you wrote above. Now that it is changed, I
won't revert it though ;-)
>>In my cforms2html.xsl stylesheet I have imported the general stylesheets:
>>
>> <xsl:import
>>href="resource://org/apache/cocoon/forms/resources/forms-page-styling.xsl"/>
>> <xsl:import
>>href="resource://org/apache/cocoon/forms/resources/forms-field-styling.xsl"/>
>>
>>But this shouldn't stop you from fixing the bug as I can set the parameter in my
>>cforms2html.xsl stylesheet.
>>
>>IIRC the forms-*samples*-styling.xsl stylesheet includes the sub-stylesheets
>>instead of importing them. If you are at it, maybe you can fix this too.
This was also with intent. Somewhere in the files it is explained.
> Actually, IIUC, changing from xsl:include to xsl:import would fix the
> issue with the duplicate variable declarations anyway, since xsl:import
> allows for overriding of variables/params/templates while xsl:include
> does not. I am unable to verify that right now though.
This would break my analogy from the comment/explanation mentioned
above, but if the XSLT spec is that stupid and if it would help to solve
the issue, I can live with it too :-)
Joerg
Re: [CForms] Stylesheets incompatible with Saxon 8
Posted by Jason Johnston <ja...@Intrado.com>.
On Tue, 2005-07-12 at 15:08 +0200, Reinhard Poetz wrote:
> Ugo Cei wrote:
> > It works. The only nagging doubt I have is whether removing the
> > parameter declaration from the included files means that they cannot be
> > used anymore by themselves. I doubt anyone is doing this, however.
>
> I'm doing this :-) As the name says, it's forms-*samples*-styling and it has
> nothing to do with my application.
I am doing this as well; in fact I'm only using forms-field-styling.xsl
not imported by anything else. So removing that variable declaration
will break the individual stylesheets when used alone. Authors
shouldn't have to create a stylesheet that does nothing but include
another single stylesheet and declare a single variable.
> In my cforms2html.xsl stylesheet I have imported the general stylesheets:
>
> <xsl:import
> href="resource://org/apache/cocoon/forms/resources/forms-page-styling.xsl"/>
> <xsl:import
> href="resource://org/apache/cocoon/forms/resources/forms-field-styling.xsl"/>
>
> But this shouldn't stop you from fixing the bug as I can set the parameter in my
> cforms2html.xsl stylesheet.
>
> IIRC the forms-*samples*-styling.xsl stylesheet includes the sub-stylesheets
> instead of importing them. If you are at it, maybe you can fix this too.
Actually, IIUC, changing from xsl:include to xsl:import would fix the
issue with the duplicate variable declarations anyway, since xsl:import
allows for overriding of variables/params/templates while xsl:include
does not. I am unable to verify that right now though.
--Jason
Re: [CForms] Stylesheets incompatible with Saxon 8
Posted by Reinhard Poetz <re...@apache.org>.
Ugo Cei wrote:
> Il giorno 12/lug/05, alle 14:40, Antonio Gallardo ha scritto:
>
>> If this will work in xalan and saxon: +1
>
>
> It works. The only nagging doubt I have is whether removing the
> parameter declaration from the included files means that they cannot be
> used anymore by themselves. I doubt anyone is doing this, however.
I'm doing this :-) As the name says, it's forms-*samples*-styling and it has
nothing to do with my application.
In my cforms2html.xsl stylesheet I have imported the general stylesheets:
<xsl:import
href="resource://org/apache/cocoon/forms/resources/forms-page-styling.xsl"/>
<xsl:import
href="resource://org/apache/cocoon/forms/resources/forms-field-styling.xsl"/>
But this shouldn't stop you from fixing the bug as I can set the parameter in my
cforms2html.xsl stylesheet.
IIRC the forms-*samples*-styling.xsl stylesheet includes the sub-stylesheets
instead of importing them. If you are at it, maybe you can fix this too.
--
Reinhard Pötz Independent Consultant, Trainer & (IT)-Coach
{Software Engineering, Open Source, Web Applications, Apache Cocoon}
web(log): http://www.poetz.cc
--------------------------------------------------------------------
Re: [CForms] Stylesheets incompatible with Saxon 8
Posted by Ugo Cei <u....@pronetics.it>.
Il giorno 12/lug/05, alle 14:40, Antonio Gallardo ha scritto:
> If this will work in xalan and saxon: +1
It works. The only nagging doubt I have is whether removing the
parameter declaration from the included files means that they cannot be
used anymore by themselves. I doubt anyone is doing this, however.
Ugo
--
Ugo Cei
Tech Blog: http://agylen.com/
Open Source Zone: http://oszone.org/
Wine & Food Blog: http://www.divinocibo.it/
Re: [CForms] Stylesheets incompatible with Saxon 8
Posted by Antonio Gallardo <ag...@agssa.net>.
Ugo Cei wrote:
> Dear Cocooners,
>
> I've started using Saxon8 instead of Xalan for all my Cocoon
> applications but it seems I've hit a snag when it comes to displaying
> forms. Looks like Saxon doesn't like the CForms stylesheets because
> the "resources-uri" variable is declared multiple times. Indeed, it is
> declared in more than one XSL file, which are in turn included by
> forms-samples-styling.xsl.
>
> Now, I don't know if Saxon is right in being so picky, but knowing
> Micheal Kay a little, I wouldn't bet against him when it comes to
> standards compliance ;).
>
> What I did locally is to remove the declaration from all the included
> files and move it to forms-samples-styling only. I did a quick tour of
> the forms samples (using Xalan) and they all seem to still work.
>
> Unless there's some serious objection, I'm going to commit this fix
> soon. We can always revert, in any case.
If this will work in xalan and saxon: +1
Best Regards,
Antonio Gallardo
Re: [CForms] Stylesheets incompatible with Saxon 8
Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Ugo Cei wrote:
> Dear Cocooners,
>
> I've started using Saxon8 instead of Xalan for all my Cocoon
> applications but it seems I've hit a snag when it comes to displaying
> forms. Looks like Saxon doesn't like the CForms stylesheets because
> the "resources-uri" variable is declared multiple times. Indeed, it is
> declared in more than one XSL file, which are in turn included by
> forms-samples-styling.xsl.
>
> Now, I don't know if Saxon is right in being so picky, but knowing
> Micheal Kay a little, I wouldn't bet against him when it comes to
> standards compliance ;).
>
> What I did locally is to remove the declaration from all the included
> files and move it to forms-samples-styling only. I did a quick tour of
> the forms samples (using Xalan) and they all seem to still work.
>
> Unless there's some serious objection, I'm going to commit this fix
> soon. We can always revert, in any case.
+1
Please go ahead and fix it. Have had the same problem, but was in a
hurry and switched back to Xalan for the CForms stylesheets instead of
fixing it.
/Daniel