cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/transformation XIncludeTransformer.java
Date Wed, 27 Jun 2001 14:51:37 GMT
cziegeler    01/06/27 07:51:37

  Modified:    src/org/apache/cocoon/transformation Tag: cocoon_20_branch
                        XIncludeTransformer.java
  Log:
  Applied patch by Jörn Heid
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.3   +11 -5     xml-cocoon2/src/org/apache/cocoon/transformation/XIncludeTransformer.java
  
  Index: XIncludeTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/transformation/XIncludeTransformer.java,v
  retrieving revision 1.6.2.2
  retrieving revision 1.6.2.3
  diff -u -r1.6.2.2 -r1.6.2.3
  --- XIncludeTransformer.java	2001/06/19 13:45:29	1.6.2.2
  +++ XIncludeTransformer.java	2001/06/27 14:51:37	1.6.2.3
  @@ -54,7 +54,7 @@
    * by the SAX event FSM yet.
    *
    * @author <a href="mailto:balld@webslingerZ.com">Donald Ball</a>
  - * @version CVS $Revision: 1.6.2.2 $ $Date: 2001/06/19 13:45:29 $ $Author: cziegeler $
  + * @version CVS $Revision: 1.6.2.3 $ $Date: 2001/06/27 14:51:37 $ $Author: cziegeler $
    */
   public class XIncludeTransformer extends AbstractTransformer implements Composable, Recyclable,
Disposable {
   
  @@ -152,9 +152,15 @@
       public void setDocumentLocator(Locator locator) {
           try {
               base_xmlbase_uri = urlFactory.getURL(locator.getSystemId());
  -            if (current_xmlbase_uri == null) {
  -                current_xmlbase_uri = base_xmlbase_uri;
  -            }
  +            current_xmlbase_uri = base_xmlbase_uri;
  +            //if (current_xmlbase_uri == null) {
  +               current_xmlbase_uri = base_xmlbase_uri;
  +            //   }
  +
  +            // If url ends with .xxx then truncate to dir
  +            if (current_xmlbase_uri.toExternalForm().lastIndexOf('.') > current_xmlbase_uri.toExternalForm().lastIndexOf('/'))
  +               current_xmlbase_uri = new URL(current_xmlbase_uri.toExternalForm().substring(0,current_xmlbase_uri.toExternalForm().lastIndexOf('/')+1));
  +
           } catch (MalformedURLException e) {getLogger().debug("XincludeTransformer", e);}
           super.setDocumentLocator(locator);
       }
  @@ -188,7 +194,7 @@
           String suffix;
           int index = href.indexOf('#');
           if (index < 0) {
  -            url = urlFactory.getURL(current_xmlbase_uri,href);
  +            url = urlFactory.getURL(current_xmlbase_uri,"/"+href);
               suffix = "";
           } else {
               url = urlFactory.getURL(current_xmlbase_uri,href.substring(0,index));
  
  
  

----------------------------------------------------------------------
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


Mime
View raw message