cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary L Peskin <ga...@firstech.com>
Subject Re: [Xalan2j][C2] Regression in Xalan2J - Part II
Date Mon, 27 Nov 2000 18:42:30 GMT
Davanum Srinivas wrote:
> 
> Thanks Gary, the Part-II of the problem is as follows. If you run the enclosed PAUL.XSP
with
> XSP.XSL, we get the following error.
> 
> "XSLT Error (javax.xml.transform.TransformerException): Error in XPath"
> 
> The problem can be fixed by checking the return code of getNamespaceNode in File
> FuncNamespace.java(Line 101) as shown below.
> ================================================================
>       else if(t == Node.ATTRIBUTE_NODE)
>       {
>         s = xctxt.getDOMHelper().getNamespaceOfNode(context);
>         if(s!=null) //Check for Null's here.
>         {
>           if(s.startsWith("xmlns:") || s.equals("xmlns"))
>             return XString.EMPTYSTRING;
>         }
>       }
> ================================================================

Dims --

I have good news and bad news.  The good news is that I just checked in
a change that should fix the XSLT Error.  It's a little different from
the change that you suggested because that part of the code was wrong in
the first place.  It should all be working now.

The bad news is that my foo.xml differs from your foo.orig.xml but I
think the old one was wrong and the new one is right.  The old code had:

xspAttr.addAttribute (
  "http://xmlns.luminas.co.uk/2000/core/page",
  "title",
  "page:title",
  "CDATA",
  "Welcome to Luminas"
);

The new code is 

xspAttr.addAttribute (
  "",                        <== Change
  "title",
  "title",                   <== Change
  "CDATA",
  "Welcome to Luminas"
);

The new code seems okay because the title attribute doesn't "inherit"
the namespace of the element and the title attribute itself has no
namespace.  XPath 5.3 states "The namespace URI of the attribute's name
will be null if the QName of the attribute does not have a prefix."

Please check this out and let me know what you think.

Gary

Mime
View raw message