You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Norman Walsh <nd...@nwalsh.com> on 2000/11/09 19:31:38 UTC

Xalan extension/import bug

XercesJ from CVS of a day or two ago...

I don't have a simple test case for this, so I'm just going to
describe the problem. If you need a simple test case...I'm sure I can
put one together.

Let's say I have stylesheet A.xsl which includes the relevant
namespace declarations and uses, for example, xalanredirect:write.
Everything works fine.

Now let's say I have stylesheet B.xsl which uses xsl:import to import
A.xsl. And let's say that B calls a named-template that's defined in
A.

Now, even though there are no references to any extension functions or
extension elements in B.xsl, if I do not declare the extension
function namespaces in B.xsl, their use in A.xsl fails.

Declaring them in B.xsl makes everything work OK again, even though
they're redundant (and theoretically should have no impact anyway
since the namespace declarations in A.xsl should have no relationship
to the declarations in B.xsl).

Aren't namespaces fun? :-)

                                        Be seeing you,
                                          norm

-- 
Norman.Walsh@East.Sun.COM | 'I have done that,' says my memory. 'I
XML Technology Center     | cannot have done that'--says my pride, and
Sun Microsystems, Inc.    | remains adamant. At last--memory
                          | yields.--Nietzsche

Re: Xalan extension/import bug

Posted by Norman Walsh <nd...@nwalsh.com>.
/ Gary L Peskin <ga...@firstech.com> was heard to say:
|  Because of the somewhat complex machinations involved with the
| extension implementation in XalanJ1, I think it's best to stick to your
| workaround until you can migrate to XalanJ2.  I don't see a quick fix
| under XalanJ1.

It was J1. I don't need a fix, I was just reporting the problem,
thanks for looking into it.  I'm glad to hear it's working under J2.

                                        Be seeing you,
                                          norm

-- 
Norman.Walsh@East.Sun.COM | A man can believe a considerable deal of
XML Technology Center     | rubbish, and yet go about his daily work in
Sun Microsystems, Inc.    | a rational and cheerful manner.--Norman
                          | Douglas

Re: Xalan extension/import bug

Posted by Gary L Peskin <ga...@firstech.com>.
Norman Walsh wrote:
> 
> XercesJ from CVS of a day or two ago...

Hi, Norm ---

Is this XalanJ1 or XalanJ2?  I suspect XalanJ1.

> I don't have a simple test case for this, so I'm just going to
> describe the problem. If you need a simple test case...I'm sure I can
> put one together.

I used this:

---------------- redir01.xsl --------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
		extension-element-prefixes="redirect"
exclude-result-prefixes="redirect">

	<xsl:template name="called">
		This is a test
		<redirect:write select="'redirtest.01'">
			This is redirected output.
		</redirect:write>
	</xsl:template>
</xsl:stylesheet>


---------------- redir02.xsl -----------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:import href="redir01.xsl"/>

<xsl:template match="/">
	<xsl:call-template name="called"/>
</xsl:template>

</xsl:stylesheet>


This worked fine with XalanJ2.  With XalanJ1, my results match yours.  I
get that the extension cannot be found until I add the xmlns:redirect
and extension-element-prefix attributes to the stylesheet element.

 Because of the somewhat complex machinations involved with the
extension implementation in XalanJ1, I think it's best to stick to your
workaround until you can migrate to XalanJ2.  I don't see a quick fix
under XalanJ1.

Gary