You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@locus.apache.org on 2000/05/11 23:15:28 UTC

cvs commit: xml-xalan/c/src/XSLT XSLTProcessorEnvSupportDefault.cpp

dbertoni    00/05/11 14:15:28

  Modified:    c/src/XSLT XSLTProcessorEnvSupportDefault.cpp
  Log:
  Added some special-case code for URL handling.
  
  Revision  Changes    Path
  1.9       +22 -2     xml-xalan/c/src/XSLT/XSLTProcessorEnvSupportDefault.cpp
  
  Index: XSLTProcessorEnvSupportDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessorEnvSupportDefault.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XSLTProcessorEnvSupportDefault.cpp	2000/05/01 15:13:11	1.8
  +++ XSLTProcessorEnvSupportDefault.cpp	2000/05/11 21:15:28	1.9
  @@ -277,9 +277,29 @@
   	}
   	else
   	{
  -		XMLParserLiaison& parserLiaison = m_processor->getXMLParserLiaison();
  +		XMLParserLiaison&	parserLiaison =
  +			m_processor->getXMLParserLiaison();
   
  -		const XMLURL		xslURL(c_wstr(base), c_wstr(urlString));
  +		// $$$ ToDo: we should re-work this code to only use
  +		// XMLRUL when necessary.
  +		XMLURL	xslURL;
  +
  +		// This is a work-around for what I believe is a bug in the
  +		// Xerces URL code.  If a base identifier ends in a slash,
  +		// they chop of characters back to the _previous_ slash.
  +		// So, for instance, a base of "/foo/foo/foo/" and a
  +		// urlString of file.xml would become /foo/foo/file.xml,
  +		// instead of /foo/foo/foo/file.xml.
  +		const unsigned int	indexOfSlash = lastIndexOf(base, '/');
  +
  +		if (indexOfSlash == length(base) - 1)
  +		{
  +			xslURL.setURL(c_wstr(base + urlString));
  +		}
  +		else
  +		{
  +			xslURL.setURL(c_wstr(base), c_wstr(urlString));
  +		}
   
   		const XMLCh* const	urlText = xslURL.getURLText();