morten      01/07/23 08:36:54

  Modified:    java/src/org/apache/xalan/xsltc/compiler Import.java
                        Include.java
  Log:
  Fix for problem with import & include introduced with the latest updated
  for TrAX URIResolvers.
  PR:           n/a
  Obtained from:        n/a
  Submitted by: [EMAIL PROTECTED]
  Reviewed by:  [EMAIL PROTECTED]
  
  Revision  Changes    Path
  1.8       +8 -6      
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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Import.java       2001/07/23 15:24:00     1.7
  +++ Import.java       2001/07/23 15:36:54     1.8
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: Import.java,v 1.7 2001/07/23 15:24:00 morten Exp $
  + * @(#)$Id: Import.java,v 1.8 2001/07/23 15:36:54 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -88,7 +88,7 @@
       public void parseContents(final Parser parser) {
        final Stylesheet context = parser.getCurrentStylesheet();
        try {
  -         final String systemId = getAttribute("href");
  +         String systemId = getAttribute("href");
            if (context.checkForLoop(systemId)) {
                final int errno = ErrorMsg.CIRCULAR_INC;
                final ErrorMsg msg = new ErrorMsg(errno, systemId, this);
  @@ -96,20 +96,22 @@
                return;
            }
   
  +         final String base = context.getSystemId();
            SourceLoader loader = context.getSourceLoader();
            InputSource input = null;
  +
            if (loader != null) {
                final XSLTC xsltc = parser.getXSLTC();
  -             final String base = context.getSystemId();
                input = loader.loadSource(base, systemId, xsltc);
            }
            else {
  -             //System.err.println("current context is 
"+context.getSystemId());
  -             //System.err.println("new file  is "+systemId);
  +             final URL url = new URL(new URL(base), systemId);
  +             systemId = url.toString();
                input = new InputSource(systemId);
            }
  +
  +         SyntaxTreeNode root = parser.parse(input);
   
  -         final SyntaxTreeNode root = parser.parse(input);
            if (root == null) return;
            final Stylesheet _imported = parser.makeStylesheet(root);
            if (_imported == null) return;
  
  
  
  1.7       +6 -3      
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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Include.java      2001/07/20 15:24:32     1.6
  +++ Include.java      2001/07/23 15:36:54     1.7
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: Include.java,v 1.6 2001/07/20 15:24:32 morten Exp $
  + * @(#)$Id: Include.java,v 1.7 2001/07/23 15:36:54 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -88,7 +88,7 @@
       public void parseContents(final Parser parser) {
        final Stylesheet context = parser.getCurrentStylesheet();
        try {
  -         final String systemId = getAttribute("href");
  +         String systemId = getAttribute("href");
            if (context.checkForLoop(systemId)) {
                final int errno = ErrorMsg.CIRCULAR_INC;
                final ErrorMsg msg = new ErrorMsg(errno, systemId, this);
  @@ -96,14 +96,17 @@
                return;
            }
   
  +         final String base = context.getSystemId();
            SourceLoader loader = context.getSourceLoader();
            InputSource input = null;
  +
            if (loader != null) {
                final XSLTC xsltc = parser.getXSLTC();
  -             final String base = context.getSystemId();
                input = loader.loadSource(base, systemId, xsltc);
            }
            else {
  +             final URL url = new URL(new URL(base), systemId);
  +             systemId = url.toString();
                input = new InputSource(systemId);
            }
   
  
  
  

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

Reply via email to