jdonohue    00/03/22 11:55:44

  Modified:    c/src/XSLT FunctionDocument.cpp
  Log:
  Looks for \ in filenames for Win32
  
  Revision  Changes    Path
  1.4       +20 -7     xml-xalan/c/src/XSLT/FunctionDocument.cpp
  
  Index: FunctionDocument.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionDocument.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FunctionDocument.cpp      2000/03/20 20:22:07     1.3
  +++ FunctionDocument.cpp      2000/03/22 19:55:44     1.4
  @@ -106,7 +106,7 @@
   
                try
                {
  -                     newDoc = executionContext.parseXML(base, localURI);
  +                     newDoc = executionContext.parseXML(localURI, base);
   
                }
                catch(...)
  @@ -187,10 +187,18 @@
                        base = executionContext.getPrefixResolver()->getURI();
                }
   
  -             // Chop off the file name part of the URI, this does not 
include the
  +             // Chop off the file name part of the URI, this includes the
                // trailing separator
  -             int ix = lastIndexOf(base, '/');
  -             base = substring(base, 0, ix);
  +             DOMString newBase;
  +             {
  +                     int indexOfSlash = lastIndexOf(base, '/');
  +#if defined(WIN32)                           
  +                     const int indexOfBackSlash = lastIndexOf(base, '\\');
  +                     if(indexOfBackSlash > indexOfSlash)
  +                             indexOfSlash = indexOfBackSlash;
  +#endif                               
  +                             newBase = substring(base, 0, indexOfSlash+1);
  +             }
   
                MutableNodeRefList              
mnl(executionContext.createMutableNodeRefList());
   
  @@ -218,15 +226,20 @@
                                // unencoded slashes in their naming schemes.  
If they do, absolute URIs
                                // will still work, but confusion may result.
                                const int indexOfColon = indexOf(ref, ':');
  -                             const int indexOfSlash = indexOf(ref, '/');
  +                             int indexOfSlash = indexOf(ref, '/');
  +#if defined(WIN32)                           
  +                             const int indexOfBackSlash = indexOf(ref, '\\');
  +                             if(indexOfBackSlash > indexOfSlash)
  +                                     indexOfSlash = indexOfBackSlash;
  +#endif                               
   
                                if(indexOfColon != -1 && indexOfSlash != -1 && 
indexOfColon < indexOfSlash)
                                {
                                        // The url (or filename, for that 
matter) is absolute.
  -                                     base = DOMString();
  +                                     newBase = DOMString();
                                }
   
  -                             const DOM_Document      newDoc = 
getDoc(executionContext, ref, base);
  +                             const DOM_Document      newDoc = 
getDoc(executionContext, ref, newBase);
   
                                if(newDoc != 0)
                                {
  
  
  

Reply via email to