dbertoni 01/07/22 18:37:57
Modified: c/src/DOMSupport DOMServices.cpp DOMServices.hpp
Log:
Added more specific implementations of getNameOfNode().
Revision Changes Path
1.30 +16 -13 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.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- DOMServices.cpp 2001/07/05 18:23:09 1.29
+++ DOMServices.cpp 2001/07/23 01:37:56 1.30
@@ -661,20 +661,23 @@
if (theNodeType == XalanNode::ATTRIBUTE_NODE)
{
- const XalanDOMString& theName = n.getNodeName();
-
- if (startsWith(theName, s_XMLNamespaceWithSeparator) == true)
- {
- // Special case for namespace nodes...
- return n.getLocalName();
- }
- else
- {
- return theName;
- }
+ return getNameOfNode(
+#if defined(XALAN_OLD_STYLE_CASTS)
+ (const XalanAttr&)n);
+#else
+ static_cast<const XalanAttr&>(n));
+#endif
}
- else if (theNodeType == XalanNode::ELEMENT_NODE ||
- theNodeType == XalanNode::PROCESSING_INSTRUCTION_NODE)
+ else if (theNodeType == XalanNode::ELEMENT_NODE)
+ {
+ return getNameOfNode(
+#if defined(XALAN_OLD_STYLE_CASTS)
+ (const XalanElement&)n);
+#else
+ static_cast<const XalanElement&>(n));
+#endif
+ }
+ else if (theNodeType == XalanNode::PROCESSING_INSTRUCTION_NODE)
{
return n.getNodeName();
}
1.24 +38 -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.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- DOMServices.hpp 2001/07/05 18:23:11 1.23
+++ DOMServices.hpp 2001/07/23 01:37:56 1.24
@@ -478,6 +478,44 @@
getNameOfNode(const XalanNode& n);
/**
+ * Retrieve the name of the node, taking into
+ * account the differences between the DOM and
+ * XSLT data models.
+ *
+ * @param attr DOM attribute node whose name is returned
+ * @return name of the node
+ */
+ static const XalanDOMString&
+ getNameOfNode(const XalanAttr& attr)
+ {
+ const XalanDOMString& theName = attr.getNodeName();
+
+ if (startsWith(theName, s_XMLNamespaceWithSeparator) == true)
+ {
+ // Special case for namespace nodes...
+ return attr.getLocalName();
+ }
+ else
+ {
+ return theName;
+ }
+ }
+
+ /**
+ * Retrieve the name of the node, taking into
+ * account the differences between the DOM and
+ * XSLT data models.
+ *
+ * @param attr DOM element node whose name is returned
+ * @return name of the node
+ */
+ static const XalanDOMString&
+ getNameOfNode(const XalanElement& element)
+ {
+ return element.getNodeName();
+ }
+
+ /**
* Retrieve local name of node, taking into
* account the differences between the DOM and
* XSLT data models.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]