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...@apache.org on 2004/12/10 08:06:16 UTC

cvs commit: xml-xalan/c/src/xalanc/PlatformSupport XalanParsedURI.cpp

dbertoni    2004/12/09 23:06:16

  Modified:    c/src/xalanc/PlatformSupport XalanParsedURI.cpp
  Log:
  Avoid trying to resolve against a base URI which is relative.
  
  Revision  Changes    Path
  1.8       +9 -6      xml-xalan/c/src/xalanc/PlatformSupport/XalanParsedURI.cpp
  
  Index: XalanParsedURI.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/XalanParsedURI.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XalanParsedURI.cpp	8 Nov 2004 18:11:05 -0000	1.7
  +++ XalanParsedURI.cpp	10 Dec 2004 07:06:15 -0000	1.8
  @@ -172,8 +172,13 @@
   	const XalanParsedURI &base
   )
   {
  +    if (base.isSchemeDefined() == false)
  +    {
  +        // Protect against a base URI that is relative...
  +        // This might become an assert or an exception.
  +    }
   	// Handle references to the current document (step 2)
  -	if ((m_defined & (d_scheme | d_authority | d_query)) == 0 &&
  +	else if ((m_defined & (d_scheme | d_authority | d_query)) == 0 &&
   		m_path.empty())
   	{
   		m_scheme	= base.m_scheme;
  @@ -190,26 +195,24 @@
   		}
   
   		m_defined |= base.m_defined;
  -		return;
   	}
  -
   	// A defined scheme component implies that this is an absolute URI (step 3)
   	// Also allow a scheme without authority that matches the base scheme to be 
   	// interpreted as a relative URI
  -	if (!(m_defined & d_scheme) || ( 
  +	else if (!(m_defined & d_scheme) || ( 
   			(base.m_defined & d_scheme) && !(m_defined & d_authority) 
   			&& equalsIgnoreCaseASCII(m_scheme, base.m_scheme)))
   	{
   		// Inherit the base scheme
   		m_scheme = base.m_scheme;
  -		m_defined |= d_scheme;
  +	    m_defined |= d_scheme;
   
   		// Step 4: If the authority is unm_defined then inherit it, otherwise skip to step 7
   		if (!(m_defined & d_authority))
   		{
   			// Inherit the base authority
   			m_authority = base.m_authority;
  -			m_defined |= d_authority;
  +            m_defined |= d_authority;
   
   			// Step 5: if the path starts with a / then it is absolute
   			if (!(m_path.length() > 0 && m_path[0] == XalanUnicode::charSolidus))
  
  
  

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