bug 90053, fix for default namespace handling in NameTest. checkin for sicking@bigfoot.com, r=me,peterv, sr=jst

This commit is contained in:
axel%pike.org 2001-07-25 04:48:10 +00:00
parent bef87ebf22
commit c09d0f2ff5
2 changed files with 6 additions and 3 deletions

View File

@ -128,14 +128,16 @@ MBool AttributeExpr::matches(Node* node, Node* context, ContextState* cs) {
Node* parent = cs->getParentNode(node);
if (parent) XMLDOMUtils::getNameSpace(prefixForNode, (Element*)parent, nsForNode);
String nsForTest;
cs->getNameSpaceURIFromPrefix(this->prefix,nsForTest);
if (prefix.length())
cs->getNameSpaceURIFromPrefix(prefix, nsForTest);
if (!nsForTest.isEqual(nsForNode)) return MB_FALSE;
return localName.isEqual(this->name);
}
else {
if (isNamespaceWild) return nodeName.isEqual(this->name);
String nsForTest;
cs->getNameSpaceURIFromPrefix(this->prefix, nsForTest);
if (prefix.length())
cs->getNameSpaceURIFromPrefix(prefix, nsForTest);
if (nsForTest.length() > 0) return MB_FALSE;
return nodeName.isEqual(this->name);
}

View File

@ -111,7 +111,8 @@ MBool ElementExpr::matches(Node* node, Node* context, ContextState* cs) {
//-- compare namespaces
String nsURI;
// use context to get namespace for testing against
cs->getNameSpaceURIFromPrefix(this->prefix, nsURI);
if (prefix.length())
cs->getNameSpaceURIFromPrefix(prefix, nsURI);
String nsURI2;
String prefix2;