I appreciate your concern about these changes, and I agree
that they need to be tested with other XSLT processors.

They have been tested only with the Xalan bundled in the
Dec-16-2002) Cocoon-2.1 snapshot, and with Saxon-7.3.1.

Here are stronger arguments for these changes:

Step 1:

The attribute "exclude-result-prefixes" stops unnecessary namespace
declarations from being added to the result tree, but does not stop
necessary namespaces from being added.  Is there an XSLT processor
we care about that has a bug in this area, or did I misread the spec?

Step 2:

A few weeks ago the "xsp:init-page" code looked like this:

            <!-- Do any user-defined necessary initializations -->
            <xsl:value-of select="xsp:init-page"/>

Then it was changed to handle multiple <xsp:init-page> tags
AND to use <xsl:copy-of> in place of <xsl:value-of>:

            <!-- Do any user-defined necessary initializations -->
            <xsl:for-each select="xsp:init-page">
              <xsl:copy-of select="."/>
            </xsl:for-each>

I am suggesting to keep the changes to handle multiple <xsp:init-page> tags,
BUT to revert the change to <xsl:copy-of> back to <xsl:value-of> to prevent
namespace declarations from sneaking into the generated java source code:

            <!-- Do any user-defined necessary initializations -->
            <xsl:for-each select="xsp:init-page">
              <xsl:value-of select="."/>
            </xsl:for-each>

I use the same argument for the <xsp:exit-page> handling
(except to note that it did not exist at all a few weeks ago):

            <!-- Do any user-defined necessary clean-ups -->
            <xsl:for-each select="xsp:exit-page">
              <xsl:value-of select="."/>
            </xsl:for-each>

Tim

>>> [EMAIL PROTECTED] 12/16/02 03:50PM >>>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Timothy:

Have you tested that those changes will not break other XSLT
processors? Saxon 7 is experimental and there is no guarantee that
further changes will not break it again. 

I'm strongly -1 about this changes

Carlos
- ----- Original Message ----- 
From: "Timothy Larson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 16, 2002 10:56 AM
Subject: [BUGFIX] Cocoon-2.1, Saxon-7.3.1, XSP pages


I solved my problem with Cocoon-2.1, Saxon-7.3.1, and XSP pages,
without breaking support for Xalan.

In the file:
 
xml-cocoon\src\java\org\apache\cocoon\components\language\markup\xsp\j
ava\xsp.xsl
I did these two steps to allow the generated java source code for XSP
pages to compile
without errors:

Step 1:

To stop the namespaces from the "xsp.xsl" stylesheet from being
inserted at the top of the generated java source file I added the
line:

  exclude-result-prefixes="xsp XSLTExtension"

To make this:

  <xsl:stylesheet version="1.0"
                xmlns:xsp="http://apache.org/xsp";
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
               
xmlns:XSLTExtension="org.apache.cocoon.components.language.markup.xsp.
XSLTExtension"
                exclude-result-prefixes="xsp XSLTExtension">

Step 2:

To stop the namespaces from the source XSP document from landing in
the "generate()" function
I changed the <xsl:copy-of select="."/> elements the <xsl:value-of
select="."/> elements in the
xsp:init-page and xsp:exit-page code in the generate() function:

            <!-- Do any user-defined necessary initializations -->
            <xsl:for-each select="xsp:init-page">
              <xsl:value-of select="."/>
            </xsl:for-each>

            <!-- Do any user-defined necessary clean-ups -->
            <xsl:for-each select="xsp:exit-page">
              <xsl:value-of select="."/>
            </xsl:for-each>

Would you do any verification you need and check these changes into
CVS please?

Tim



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to