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 2001/01/08 19:26:58 UTC

cvs commit: xml-xalan/c/src/XPath SimpleNodeLocator.cpp

dbertoni    01/01/08 10:26:58

  Modified:    c/src/XPath SimpleNodeLocator.cpp
  Log:
  Removed support for processing without namespaces.  Removed references to XPathSupport.  Better scoping of variables in nodeTest().
  
  Revision  Changes    Path
  1.29      +18 -8     xml-xalan/c/src/XPath/SimpleNodeLocator.cpp
  
  Index: SimpleNodeLocator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/SimpleNodeLocator.cpp,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- SimpleNodeLocator.cpp	2001/01/03 19:32:39	1.28
  +++ SimpleNodeLocator.cpp	2001/01/08 18:26:57	1.29
  @@ -1486,13 +1486,11 @@
   							0 == length(targetNS) &&
   							currentExpression.getOpCodeMapValue(opPos) == XPathExpression::eELEMWILDCARD;
   
  -				const bool	processNamespaces = executionContext.getProcessNamespaces();
  -
   				bool		didMatchNS = false;
   
  -				if(isTotallyWild == false && processNamespaces == true)
  +				if(isTotallyWild == false)
   				{
  -					const XalanDOMString&	contextNS = executionContext.getNamespaceOfNode(*context);
  +					const XalanDOMString&	contextNS = context->getNamespaceURI();
   
   					if(0 != length(targetNS) && 0 != length(contextNS))
   					{
  @@ -1515,9 +1513,6 @@
   
   				if(test == true)
   				{
  -					const XalanDOMString&	targetLocalName =
  -								queueIndex >= 0 ? currentExpression.getToken(queueIndex)->str() : s_emptyString;
  -
   					switch(nodeType)
   					{
   					case XalanNode::ATTRIBUTE_NODE:
  @@ -1556,8 +1551,13 @@
   								{
   									if (isNamespace == false)
   									{
  +										assert(queueIndex >= 0);
  +
  +										const XalanDOMString&	targetLocalName =
  +															currentExpression.getToken(queueIndex)->str();
  +
   										const XalanDOMString&	localAttrName =
  -											DOMServices::getLocalNameOfNode(*context);
  +												DOMServices::getLocalNameOfNode(*context);
   
   										if (equals(localAttrName, targetLocalName) == true)
   										{
  @@ -1580,6 +1580,11 @@
   										const XalanDOMString&	theNamespace =
   													theAttrNode->getValue();
   
  +										assert(queueIndex >= 0);
  +
  +										const XalanDOMString&	targetLocalName =
  +															currentExpression.getToken(queueIndex)->str();
  +
   										if (equals(theNamespace, targetLocalName) == true)
   										{
   											score = xpath.s_MatchScoreQName;
  @@ -1600,6 +1605,11 @@
   							}
   							else
   							{
  +								assert(queueIndex >= 0);
  +
  +								const XalanDOMString&	targetLocalName =
  +															currentExpression.getToken(queueIndex)->str();
  +
   								if (equals(DOMServices::getLocalNameOfNode(*context),
   										   targetLocalName) == true)
   								{