tmiller     01/09/06 06:45:06

  Modified:    java/src/org/apache/xalan/xsltc/compiler Include.java
                        Import.java
  Log:
  bug fix 3426, gunnlaugur briem's fix
  
  Revision  Changes    Path
  1.8       +11 -11    
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Include.java
  
  Index: Include.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Include.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Include.java      2001/07/23 15:36:54     1.7
  +++ Include.java      2001/09/06 13:45:06     1.8
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: Include.java,v 1.7 2001/07/23 15:36:54 morten Exp $
  + * @(#)$Id: Include.java,v 1.8 2001/09/06 13:45:06 tmiller Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -59,7 +59,7 @@
    * @author Jacek Ambroziak
    * @author Morten Jorgensen
    * @author Erwin Bolwidt <[EMAIL PROTECTED]>
  - *
  + * @author Gunnlaugur Briem <[EMAIL PROTECTED]>
    */
   
   package org.apache.xalan.xsltc.compiler;
  @@ -88,26 +88,26 @@
       public void parseContents(final Parser parser) {
        final Stylesheet context = parser.getCurrentStylesheet();
        try {
  -         String systemId = getAttribute("href");
  -         if (context.checkForLoop(systemId)) {
  +         String docToLoad = getAttribute("href");
  +         if (context.checkForLoop(docToLoad)) {
                final int errno = ErrorMsg.CIRCULAR_INC;
  -             final ErrorMsg msg = new ErrorMsg(errno, systemId, this);
  +             final ErrorMsg msg = new ErrorMsg(errno, docToLoad, this);
                parser.reportError(Constants.FATAL, msg);
                return;
            }
   
  -         final String base = context.getSystemId();
  +         final String currLoadedDoc = context.getSystemId();
            SourceLoader loader = context.getSourceLoader();
            InputSource input = null;
   
            if (loader != null) {
                final XSLTC xsltc = parser.getXSLTC();
  -             input = loader.loadSource(base, systemId, xsltc);
  +             input = loader.loadSource(docToLoad, currLoadedDoc, xsltc);
            }
            else {
  -             final URL url = new URL(new URL(base), systemId);
  -             systemId = url.toString();
  -             input = new InputSource(systemId);
  +             final URL url = new URL(new URL(currLoadedDoc), docToLoad);
  +             docToLoad = url.toString();
  +             input = new InputSource(docToLoad);
            }
   
            final SyntaxTreeNode root = parser.parse(input);
  @@ -116,7 +116,7 @@
            if (_included == null) return;
   
            _included.setSourceLoader(loader);
  -         _included.setSystemId(systemId);
  +         _included.setSystemId(docToLoad);
            _included.setParentStylesheet(context);
   
            // An included stylesheet gets the same import precedence
  
  
  
  1.9       +11 -10    
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Import.java
  
  Index: Import.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Import.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Import.java       2001/07/23 15:36:54     1.8
  +++ Import.java       2001/09/06 13:45:06     1.9
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: Import.java,v 1.8 2001/07/23 15:36:54 morten Exp $
  + * @(#)$Id: Import.java,v 1.9 2001/09/06 13:45:06 tmiller Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -59,6 +59,7 @@
    * @author Jacek Ambroziak
    * @author Morten Jorgensen
    * @author Erwin Bolwidt <[EMAIL PROTECTED]>
  + * @author Gunnlaugur Briem <[EMAIL PROTECTED]>
    *
    */
   
  @@ -88,26 +89,26 @@
       public void parseContents(final Parser parser) {
        final Stylesheet context = parser.getCurrentStylesheet();
        try {
  -         String systemId = getAttribute("href");
  -         if (context.checkForLoop(systemId)) {
  +         String docToLoad = getAttribute("href");
  +         if (context.checkForLoop(docToLoad)) {
                final int errno = ErrorMsg.CIRCULAR_INC;
  -             final ErrorMsg msg = new ErrorMsg(errno, systemId, this);
  +             final ErrorMsg msg = new ErrorMsg(errno, docToLoad, this);
                parser.reportError(Constants.FATAL, msg);
                return;
            }
   
  -         final String base = context.getSystemId();
  +         final String currLoadedDoc = context.getSystemId();
            SourceLoader loader = context.getSourceLoader();
            InputSource input = null;
   
            if (loader != null) {
                final XSLTC xsltc = parser.getXSLTC();
  -             input = loader.loadSource(base, systemId, xsltc);
  +             input = loader.loadSource(docToLoad, currLoadedDoc, xsltc);
            }
            else {
  -             final URL url = new URL(new URL(base), systemId);
  -             systemId = url.toString();
  -             input = new InputSource(systemId);
  +             final URL url = new URL(new URL(currLoadedDoc), docToLoad);
  +             docToLoad = url.toString();
  +             input = new InputSource(docToLoad);
            }
   
            SyntaxTreeNode root = parser.parse(input);
  @@ -117,7 +118,7 @@
            if (_imported == null) return;
   
            _imported.setSourceLoader(loader);
  -         _imported.setSystemId(systemId);
  +         _imported.setSystemId(docToLoad);
            _imported.setParentStylesheet(context);
   
            // precedence for the including stylesheet
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to