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
--------------------------------------------------------------------