You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Eric Schaeffer <es...@blocks4you.com> on 2001/05/23 10:16:43 UTC

BUG - Xalan-J 2.0.1 - Redirect extension

Hi,

First, I haven't subscribe to the mailing list. Please reply to my personnal
email if you want to speak to me...

I've found a bug in the Redirect extension.
When I use it with Ant (using the "style", that is XSLT transform, build-in
task) on Windows / JDK 1.3, redirect filenames are wrong.
When used with Ant, that's the source base URL that is used to resolve
relative paths. And the source base URL is, on my computer, something like
"file:C:/dir/file". Thus, in the urlToFileName private method, that's the
last case that is executed : 
    ....
      else if(base.startsWith("file:/"))
      {
        base = base.substring(5);
      }
      else if(base.startsWith("file:")) // this one
      {
        base = base.substring(4);
      }
    }
    return base;

The returned value is then ":C:/dir/file", that is wrong. You can change
"base = base.substring(4);" to "base = base.substring(5);", or use the
java.net.URL class (on JDK 1.3, the URL.getPath() method works well).

Eric.


freebie companion tool (XPath)

Posted by Paul Brown <pr...@fivesight.com>.
All --

I've packaged an XML productivity tool that wraps the XPath API in XalanJ2.
Essentially, you can load a document into a tree view, type XPath queries,
and see the resulting NodeSet highlighted or value displayed.  (It even has
a real-time mode that will apply the query as you type.)  An executable jar
(java -jar foo.jar) is available from
http://www.fivesight.com/downloads/xpathtester.asp.

Cheers,

Paul Brown
FiveSight Technologies, Inc.