You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Davanum Srinivas <di...@yahoo.com> on 2000/11/27 14:03:06 UTC

[Xalan2j][C2] Regression in Xalan2J - Part II

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;
        }
      }
================================================================

Thanks,
dims

--- Gary L Peskin <ga...@firstech.com> wrote:
> Davanum Srinivas wrote:
> > 
> > Scott,
> > 
> > Enclosed in the Bugs.ZIP there are two files PAUL.XSP and XSP.XSL. We hava a Xalan.JAR built
> on
> > 9:49AM EST Nov 21, 2000. The sample works with that version. But the latest Xalan from CVS
> gives
> > us the following error.
> > 
> >     "Could not find template named: process-first-element"
> > 
> > Can you please fix the problem and let us know. Please see foo.orig.xml which contains the
> valid
> > output. You can use this to compare the output.
> 
> Dims --
> 
> I just checked in a change to fix this bug.  Thanks for finding it!
> 
> Gary


=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

Re: [Xalan2j][C2] Regression in Xalan2J - Part II

Posted by Gary L Peskin <ga...@firstech.com>.
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

Re: [Xalan2j][C2] Regression in Xalan2J - Part II

Posted by Gary L Peskin <ga...@firstech.com>.
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