dbertoni 01/01/26 08:22:14
Modified: c/src/DOMSupport DOMServices.cpp DOMServices.hpp
Log:
New implementation of getNamespaceOfNode().
Revision Changes Path
1.23 +26 -0 xml-xalan/c/src/DOMSupport/DOMServices.cpp
Index: DOMServices.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/DOMSupport/DOMServices.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- DOMServices.cpp 2001/01/08 18:12:24 1.22
+++ DOMServices.cpp 2001/01/26 16:22:14 1.23
@@ -464,6 +464,32 @@
+const XalanDOMString&
+DOMServices::getNamespaceOfNode(const XalanNode& n)
+{
+ if (n.getNodeType() == XalanNode::ATTRIBUTE_NODE)
+ {
+ const XalanDOMString& theNodeName = n.getNodeName();
+
+ // Special case for namespace nodes...
+ if (startsWith(theNodeName,
DOMServices::s_XMLNamespaceWithSeparator) == true ||
+ equals(theNodeName, DOMServices::s_XMLNamespace) ==
true)
+ {
+ return s_emptyString;
+ }
+ else
+ {
+ return n.getNamespaceURI();
+ }
+ }
+ else
+ {
+ return n.getNamespaceURI();
+ }
+}
+
+
+
// Note functional overlap with NamespaceResolver's
// getNamespaceOfNode() method.
//
1.18 +11 -0 xml-xalan/c/src/DOMSupport/DOMServices.hpp
Index: DOMServices.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/DOMSupport/DOMServices.hpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- DOMServices.hpp 2001/01/08 18:12:24 1.17
+++ DOMServices.hpp 2001/01/26 16:22:14 1.18
@@ -379,6 +379,17 @@
}
/**
+ * Retrieve the namespace of the node, taking into
+ * account the differences between the DOM and
+ * XSLT data models.
+ *
+ * @param node DOM node whose namespace is returned
+ * @return namespace of the node
+ */
+ static const XalanDOMString&
+ getNamespaceOfNode(const XalanNode& n);
+
+ /**
* Retrieve the parent of a node. This function has to be implemented,
* because the DOM WG decided that attributes don't have parents.
*