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/30 23:02:44 UTC
cvs commit: xml-xalan/c/src/XSLT ResultNamespacesStack.cpp ResultNamespacesStack.hpp
dbertoni 01/01/30 14:02:44
Modified: c/src/XSLT ResultNamespacesStack.cpp
ResultNamespacesStack.hpp
Log:
Added accessor to check for mapping of prefix.
Revision Changes Path
1.2 +37 -0 xml-xalan/c/src/XSLT/ResultNamespacesStack.cpp
Index: ResultNamespacesStack.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ResultNamespacesStack.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ResultNamespacesStack.cpp 2000/11/20 20:00:07 1.1
+++ ResultNamespacesStack.cpp 2001/01/30 22:02:42 1.2
@@ -160,6 +160,43 @@
+bool
+ResultNamespacesStack::prefixIsPresentLocal(const XalanDOMString& thePrefix)
+{
+ bool fResult = false;
+
+ // Check to see if we need to create a new context. If so, there are
+ // no prefixes mapped at this level, so return false...
+ if (m_createNewContextStack.back() == false)
+ {
+ const NamespaceVectorType& theNamespaces =
+ m_resultNamespaces.back();
+
+ NamespaceVectorType::const_iterator i = theNamespaces.begin();
+ const NamespaceVectorType::const_iterator theEnd = theNamespaces.end();
+
+ while(i != theEnd && fResult == false)
+ {
+ const NameSpace& ns = (*i);
+
+ const XalanDOMString& thisPrefix = ns.getPrefix();
+
+ if(::equals(thePrefix, thisPrefix))
+ {
+ fResult = true;
+ }
+ else
+ {
+ ++i;
+ }
+ }
+ }
+
+ return fResult;
+}
+
+
+
void
ResultNamespacesStack::clear()
{
1.3 +8 -0 xml-xalan/c/src/XSLT/ResultNamespacesStack.hpp
Index: ResultNamespacesStack.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ResultNamespacesStack.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ResultNamespacesStack.hpp 2001/01/26 16:26:55 1.2
+++ ResultNamespacesStack.hpp 2001/01/30 22:02:43 1.3
@@ -114,6 +114,14 @@
const XalanDOMString&
getPrefixForNamespace(const XalanDOMString& theNamespaceURI) const;
+
+ /**
+ * See if the prefix has been mapped to a namespace in the current
+ * context, without looking down the stack of namespaces.
+ */
+ bool
+ prefixIsPresentLocal(const XalanDOMString& thePrefix);
+
void
clear();