xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbert...@apache.org
Subject cvs commit: xml-xalan/c/src/XPath XPathProcessorImpl.cpp
Date Fri, 16 Nov 2001 19:34:22 GMT
dbertoni    01/11/16 11:34:22

  Modified:    c/src/XPath XPathProcessorImpl.cpp
  Log:
  Check to see that a prefix has been bound to a valid namespace URI.
  
  Revision  Changes    Path
  1.45      +16 -14    xml-xalan/c/src/XPath/XPathProcessorImpl.cpp
  
  Index: XPathProcessorImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathProcessorImpl.cpp,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- XPathProcessorImpl.cpp	2001/07/12 04:35:49	1.44
  +++ XPathProcessorImpl.cpp	2001/11/16 19:34:22	1.45
  @@ -603,32 +603,34 @@
   
   	const XalanDOMString 			prefix =
   				substring(pat, startSubstring, posOfNSSep);
  +	assert(length(prefix) != 0);
   
   	const XalanDOMString* const		uName =
   				m_prefixResolver->getNamespaceForPrefix(prefix);
   
  -	if(uName != 0 && length(*uName) > 0)
  +	if(uName == 0)
   	{
  -		addToTokenQueue(*uName);
  -
  -		addToTokenQueue(DOMServices::s_XMLNamespaceSeparatorString);
  -
  -		const XalanDOMString 	s = substring(pat, posOfNSSep + 1, posOfScan);
  -	  
  -		if(length(s) > 0)
  -		{
  -			addToTokenQueue(s);
  -		}
  +		error(
  +			TranscodeFromLocalCodePage("Unable to resolve prefix '") +
  +			prefix +
  +			TranscodeFromLocalCodePage("'."));
   	}
  +	else if (length(*uName) == 0)
  +	{
  +		error(
  +			TranscodeFromLocalCodePage("The prefix '") +
  +			prefix +
  +			TranscodeFromLocalCodePage("' is bound to a zero-length URI."));
  +	}
   	else
   	{
  -		addToTokenQueue(prefix);
  +		addToTokenQueue(*uName);
   
   		addToTokenQueue(DOMServices::s_XMLNamespaceSeparatorString);
   
   		const XalanDOMString 	s = substring(pat, posOfNSSep + 1, posOfScan);
  -
  -		if(s.length() > 0)
  +	  
  +		if(length(s) > 0)
   		{
   			addToTokenQueue(s);
   		}
  
  
  

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


Mime
View raw message