cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: cocoon-2.0/src/java/org/apache/cocoon/transformation XIncludeTransformer.java
Date Tue, 20 May 2003 20:53:22 GMT
bruno       2003/05/20 13:53:22

  Modified:    src/java/org/apache/cocoon/transformation
                        XIncludeTransformer.java
  Log:
  in setDocumentLocator, check that systemid is not null before using it.
  This fixes bug 8379.
  
  Revision  Changes    Path
  1.2       +16 -13    cocoon-2.0/src/java/org/apache/cocoon/transformation/XIncludeTransformer.java
  
  Index: XIncludeTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.0/src/java/org/apache/cocoon/transformation/XIncludeTransformer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XIncludeTransformer.java	9 Mar 2003 00:03:24 -0000	1.1
  +++ XIncludeTransformer.java	20 May 2003 20:53:22 -0000	1.2
  @@ -182,18 +182,21 @@
                   getLogger().debug("setDocumentLocator called " + locator.getSystemId());
               }
   
  -            base_xmlbase_uri = this.resolver.resolve(locator.getSystemId());
  +            // When using SAXON to serialize a DOM tree to SAX, a locator is passed with
a "null" system id
  +            if (locator.getSystemId() != null) {
  +                base_xmlbase_uri = this.resolver.resolve(locator.getSystemId());
   
  -            // If url ends with .xxx then truncate to dir
  -            if (base_xmlbase_uri.getSystemId().lastIndexOf('.') > base_xmlbase_uri.getSystemId().lastIndexOf('/'))
{
  -               String uri = base_xmlbase_uri.getSystemId().substring(0,base_xmlbase_uri.getSystemId().lastIndexOf('/')+1);
  -               base_xmlbase_uri.recycle();
  -               base_xmlbase_uri = null;
  -               base_xmlbase_uri = this.resolver.resolve(uri);
  -            }
  +                // If url ends with .xxx then truncate to dir
  +                if (base_xmlbase_uri.getSystemId().lastIndexOf('.') > base_xmlbase_uri.getSystemId().lastIndexOf('/'))
{
  +                   String uri = base_xmlbase_uri.getSystemId().substring(0,base_xmlbase_uri.getSystemId().lastIndexOf('/')+1);
  +                   base_xmlbase_uri.recycle();
  +                   base_xmlbase_uri = null;
  +                   base_xmlbase_uri = this.resolver.resolve(uri);
  +                }
   
  -            if (current_xmlbase_uri == null) {
  -               current_xmlbase_uri = base_xmlbase_uri;
  +                if (current_xmlbase_uri == null) {
  +                   current_xmlbase_uri = base_xmlbase_uri;
  +                }
               }
   
           } catch (Exception e) {
  
  
  

Mime
View raw message