tng 2002/09/27 12:21:28
Modified: c/src/xercesc/dom/impl DOMNodeImpl.cpp
Log:
DOM L3 fix: lookupnamespaceURI and isDefaultNamespace.
Revision Changes Path
1.19 +7 -17 xml-xerces/c/src/xercesc/dom/impl/DOMNodeImpl.cpp
Index: DOMNodeImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMNodeImpl.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- DOMNodeImpl.cpp 26 Sep 2002 17:26:04 -0000 1.18
+++ DOMNodeImpl.cpp 27 Sep 2002 19:21:28 -0000 1.19
@@ -548,10 +548,10 @@
const XMLCh* DOMNodeImpl::lookupNamespacePrefix(const XMLCh* const namespaceURI,
bool useDefault, DOMElement *el) const {
DOMNode *thisNode = castToNode(this);
- const XMLCh* ns = getNamespaceURI();
+ const XMLCh* ns = thisNode->getNamespaceURI();
// REVISIT: if no prefix is available is it null or empty string, or
// could be both?
- const XMLCh* prefix = getPrefix();
+ const XMLCh* prefix = thisNode->getPrefix();
if (ns != 0 && XMLString::equals(ns,namespaceURI)) {
if (useDefault || prefix != 0) {
@@ -602,8 +602,8 @@
short type = thisNode->getNodeType();
switch (type) {
case DOMNode::ELEMENT_NODE : {
- const XMLCh* ns = getNamespaceURI();
- const XMLCh* prefix = getPrefix();
+ const XMLCh* ns = thisNode->getNamespaceURI();
+ const XMLCh* prefix = thisNode->getPrefix();
if (ns != 0) {
// REVISIT: is it possible that prefix is empty string?
if (specifiedPrefix == 0 && prefix == specifiedPrefix) {
@@ -914,21 +914,11 @@
short type = thisNode->getNodeType();
switch (type) {
case DOMNode::ELEMENT_NODE: {
- //if we dont find a xmlns and we are looking for "" then its true
-
if(thisNode->isSameNode(thisNode->getOwnerDocument()->getDocumentElement())) {
- if(namespaceURI == 0) {
- return true;
- }
- }
-
const XMLCh *prefix = thisNode->getPrefix();
+
// REVISIT: is it possible that prefix is empty string?
if (prefix == 0 || !*prefix) {
- const XMLCh* ns = thisNode->getNamespaceURI();
- if (namespaceURI == 0) {
- return (ns == namespaceURI);
- }
- return XMLString::equals(namespaceURI, ns);
+ return XMLString::equals(namespaceURI, thisNode->getNamespaceURI());
}
if (thisNode->hasAttributes()) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]