You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2001/06/01 08:19:59 UTC

cvs commit: xml-cocoon2/src/org/apache/cocoon/transformation TraxTransformer.java

cziegeler    01/05/31 23:19:58

  Modified:    src/org/apache/cocoon/transformation TraxTransformer.java
  Log:
  Fixes for the resolve method reported by Rob Moffat
  
  Revision  Changes    Path
  1.15      +6 -11     xml-cocoon2/src/org/apache/cocoon/transformation/TraxTransformer.java
  
  Index: TraxTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/transformation/TraxTransformer.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- TraxTransformer.java	2001/05/31 17:39:01	1.14
  +++ TraxTransformer.java	2001/06/01 06:19:56	1.15
  @@ -100,7 +100,7 @@
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
    * @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a>
  - * @version CVS $Id: TraxTransformer.java,v 1.14 2001/05/31 17:39:01 bloritsch Exp $
  + * @version CVS $Id: TraxTransformer.java,v 1.15 2001/06/01 06:19:56 cziegeler Exp $
    */
   public class TraxTransformer extends ContentHandlerWrapper
   implements Transformer, Composable, Recyclable, Configurable, Cacheable, Disposable, URIResolver {
  @@ -259,18 +259,13 @@
   
                   // is the base a file or a real url
                   if (base.startsWith("file:") == false) {
  -                    java.net.URL url = new java.net.URL(base);
  -                    String parentPath = url.getPath();
  -                    int lastPathElementPos = parentPath.indexOf('/');
  +                    int lastPathElementPos = base.lastIndexOf('/');
                       if (lastPathElementPos == -1) {
  -                        xslSource = this.resolver.resolve(url.getProtocol()+ "://"
  -                                                       + url.getHost()+ ":"
  -                                                       + url.getPort()+ "/" + href);
  +                        // this should never occur as the base should
  +                        // always be protol:/....
  +                        return null; // we can't resolve this
                       } else {
  -                        xslSource = this.resolver.resolve(url.getProtocol()+ "://"
  -                                                       + url.getHost()+ ":"
  -                                                       + url.getPort()+ "/"
  -                                                       + parentPath.substring(0, lastPathElementPos)
  +                        xslSource = this.resolver.resolve(base.substring(0, lastPathElementPos)
                                                          + "/" + href);
                       }
                   } else {
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org