You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sa...@apache.org on 2003/11/04 19:53:34 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/trax TransformerImpl.java

santiagopg    2003/11/04 10:53:34

  Modified:    java/src/org/apache/xalan/xsltc/trax TransformerImpl.java
  Log:
  Patch for Bugzilla 24188 by Bhakti Mehta (Bhakti.Mehta@sun.com). The runtime now attempts to resolve a reference when the URI resolver returns null.
  
  Revision  Changes    Path
  1.75      +25 -8     xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerImpl.java
  
  Index: TransformerImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerImpl.java,v
  retrieving revision 1.74
  retrieving revision 1.75
  diff -u -r1.74 -r1.75
  --- TransformerImpl.java	22 Oct 2003 18:51:29 -0000	1.74
  +++ TransformerImpl.java	4 Nov 2003 18:53:34 -0000	1.75
  @@ -96,6 +96,8 @@
   import javax.xml.transform.stream.StreamResult;
   import javax.xml.transform.stream.StreamSource;
   
  +import org.apache.xml.utils.SystemIDResolver;
  +
   import org.apache.xalan.xsltc.DOM;
   import org.apache.xalan.xsltc.DOMCache;
   import org.apache.xalan.xsltc.StripFilter;
  @@ -1205,13 +1207,28 @@
        * @param translet A reference to the translet requesting the document
        */
       public DOM retrieveDocument(String baseURI, String href, Translet translet) {
  -	try {
  -        
  -        // Argument to document function was: document('');
  -        if (href.length() == 0) {
  -            href = new String(baseURI);
  -        }    
  -	    return getDOM(_uriResolver.resolve(href, baseURI));
  +	try {        
  +            // Argument to document function was: document('');
  +            if (href.length() == 0) {
  +                href = new String(baseURI);
  +            }    
  +
  +            /*
  +             *  Fix for bug 24188
  +             *  Incase the _uriResolver.resolve(href,base) is null
  +             *  try to still  retrieve the document before returning null 
  +             *  and throwing the FileNotFoundException in
  +             *  org.apache.xalan.xsltc.dom.LoadDocument
  +             *
  +             */
  +            Source resolvedSource = _uriResolver.resolve(href, baseURI);
  +            if (resolvedSource == null)  {
  +                StreamSource streamSource = new StreamSource(
  +                     SystemIDResolver.getAbsoluteURI(href, baseURI));
  +                return getDOM(streamSource) ;
  +            } 
  +
  +            return getDOM(resolvedSource);
   	}
   	catch (TransformerException e) {
   	    if (_errorListener != null)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org