sboag       00/06/24 11:32:47

  Modified:    java/src/org/apache/xalan/templates FuncDocument.java
                        Stylesheet.java StylesheetComposed.java
                        StylesheetRoot.java TemplateList.java
  Log:
  Fixed some stuff mainly pertaining to xsl:import, but also the document() 
function.
  
  Revision  Changes    Path
  1.2       +3 -3      
xml-xalan/java/src/org/apache/xalan/templates/FuncDocument.java
  
  Index: FuncDocument.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/FuncDocument.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FuncDocument.java 2000/06/19 16:52:50     1.1
  +++ FuncDocument.java 2000/06/24 18:32:46     1.2
  @@ -220,13 +220,13 @@
         TransformerImpl transformer = (TransformerImpl)xctxt.getOwnerObject();
         
         { 
  -        java.net.URL url = null;
  +        String url = null;
           try
           {
  -          url = xctxt.getURLFromString(uri, base);
  +          url = xctxt.getAbsoluteURI(uri, base);
             if((null != url) && (url.toString().length() > 0))
             {
  -            InputSource inputSource = new InputSource(url.toString());
  +            InputSource inputSource = new InputSource(url);
               // System.out.println("Trying to parse: "+url.toString());
               newDoc = transformer.parseToNode(inputSource);
             }
  
  
  
  1.2       +4 -5      
xml-xalan/java/src/org/apache/xalan/templates/Stylesheet.java
  
  Index: Stylesheet.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/Stylesheet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Stylesheet.java   2000/06/19 16:52:52     1.1
  +++ Stylesheet.java   2000/06/24 18:32:46     1.2
  @@ -61,7 +61,6 @@
   import java.io.ObjectInputStream;
   import java.io.IOException;
   import java.io.ObjectOutputStream;
  -import java.net.URL;
   import java.text.DecimalFormatSymbols;
   import java.util.Hashtable;
   import java.util.Stack;
  @@ -955,14 +954,14 @@
      * The base URL of the XSL document.
      * @serial
      */
  -  private URL m_href = null;
  +  private String m_href = null;
     private String m_publicId;
     private String m_systemId;
   
     /**
      * Get the base identifier with which this stylesheet is associated.
      */
  -  public URL getHref()
  +  public String getHref()
     {
       return m_href;
     }
  @@ -970,7 +969,7 @@
     /**
      * Get the base identifier with which this stylesheet is associated.
      */
  -  public void setHref(URL baseIdent)
  +  public void setHref(String baseIdent)
     {
       m_href = baseIdent;
     }
  @@ -987,7 +986,7 @@
       {
         try
         {
  -        m_href = SystemIDResolver.getURLFromString(m_systemId, null);
  +        m_href = SystemIDResolver.getAbsoluteURI(m_systemId, null);
         }
         catch(SAXException se)
         {
  
  
  
  1.2       +2 -2      
xml-xalan/java/src/org/apache/xalan/templates/StylesheetComposed.java
  
  Index: StylesheetComposed.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/StylesheetComposed.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StylesheetComposed.java   2000/06/19 16:52:52     1.1
  +++ StylesheetComposed.java   2000/06/24 18:32:46     1.2
  @@ -270,7 +270,7 @@
      * A list of properties that specify how to do space 
      * stripping. This uses the same exact mechanism as Templates.
      */
  -  private transient TemplateList m_whiteSpaceInfoList;
  +  private transient WhitespaceList m_whiteSpaceInfoList;
     
     /**
      * Compile a lookup table for WhiteSpaceInfo elements, which are built
  @@ -280,7 +280,7 @@
     void recomposeWhiteSpaceInfo()
       throws SAXException
     {
  -    m_whiteSpaceInfoList = new TemplateList(this);
  +    m_whiteSpaceInfoList = new WhitespaceList(this);
       
       int nIncludes = getIncludeCountComposed();
       for(int k = -1; k < nIncludes; k++)
  
  
  
  1.2       +3 -3      
xml-xalan/java/src/org/apache/xalan/templates/StylesheetRoot.java
  
  Index: StylesheetRoot.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/StylesheetRoot.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StylesheetRoot.java       2000/06/19 16:52:52     1.1
  +++ StylesheetRoot.java       2000/06/24 18:32:46     1.2
  @@ -58,7 +58,6 @@
   
   import org.w3c.dom.*;
   import java.util.*;
  -import java.net.URL;
   import java.net.MalformedURLException;
   import java.io.*;
   import org.xml.sax.*;
  @@ -333,6 +332,7 @@
           addImports(included);
         }
       }
  +    m_globalImportList.insertElementAt(stylesheet, 0);
     }
     
     /**
  @@ -393,10 +393,10 @@
       if(this == sheet)
         return 0;
       
  -    int n = getImportCount();
  +    int n = getGlobalImportCount();
       for(int i = 0; i < n; i++)
       {
  -      if(this == getImport(i))
  +      if(sheet == getGlobalImport(i))
           return i;
       }
       return -1;
  
  
  
  1.2       +19 -2     
xml-xalan/java/src/org/apache/xalan/templates/TemplateList.java
  
  Index: TemplateList.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/TemplateList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TemplateList.java 2000/06/19 16:52:52     1.1
  +++ TemplateList.java 2000/06/24 18:32:47     1.2
  @@ -335,8 +335,8 @@
         {
           StylesheetComposed imported = stylesheet.getImportComposed(i);
           bestMatchedRule 
  -          = imported.getTemplateComposed(support, 
  -                                         targetNode, mode, 
quietConflictWarnings);
  +          = getTemplate(imported, support, targetNode, mode, 
  +                        quietConflictWarnings);
           if(null != bestMatchedRule)
             break;
         }
  @@ -381,6 +381,23 @@
   
       return bestMatchedRule;
     } // end findTemplate
  +  
  +  /**
  +   * For derived classes to override which method gets accesed to 
  +   * get the imported template.
  +   */
  +  protected ElemTemplate getTemplate(StylesheetComposed imported,
  +                                     XPathContext support,
  +                                     Node targetNode,
  +                                     QName mode,
  +                                     boolean quietConflictWarnings)
  +    throws SAXException
  +  {
  +    return imported.getTemplateComposed(support, 
  +                                         targetNode, mode, 
  +                                         quietConflictWarnings);
  +  }
  +
     
     /**
      * Set the manufactured template if there is no wrapper.
  
  
  

Reply via email to