From 5e2036fad35f6b5abd3de6b21fba29867a117eed Mon Sep 17 00:00:00 2001 From: "kvisco%ziplink.net" Date: Tue, 7 Nov 2000 10:46:03 +0000 Subject: [PATCH] Not part of regular build. Added new method for NamespaceResolver git-svn-id: svn://10.0.0.236/trunk@82380 18797224-902f-48f8-a5cc-f745e15eee43 --- .../transformiix/source/xslt/ProcessorState.cpp | 14 +++++++++++--- .../transformiix/source/xslt/ProcessorState.h | 13 ++++++++----- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/mozilla/extensions/transformiix/source/xslt/ProcessorState.cpp b/mozilla/extensions/transformiix/source/xslt/ProcessorState.cpp index 4ad72ebd372..4f8261b466a 100644 --- a/mozilla/extensions/transformiix/source/xslt/ProcessorState.cpp +++ b/mozilla/extensions/transformiix/source/xslt/ProcessorState.cpp @@ -25,13 +25,13 @@ * -- added code in ::resolveFunctionCall to support the * document() function. * - * $Id: ProcessorState.cpp,v 1.11 2000-10-06 08:59:46 Peter.VanderBeken%pandora.be Exp $ + * $Id: ProcessorState.cpp,v 1.12 2000-11-07 10:46:03 kvisco%ziplink.net Exp $ */ /** * Implementation of ProcessorState * Much of this code was ported from XSL:P - * @version $Revision: 1.11 $ $Date: 2000-10-06 08:59:46 $ + * @version $Revision: 1.12 $ $Date: 2000-11-07 10:46:03 $ **/ #include "ProcessorState.h" @@ -412,8 +412,16 @@ Element* ProcessorState::getNamedTemplate(String& name) { **/ void ProcessorState::getNameSpaceURI(const String& name, String& nameSpaceURI) { String prefix; - XMLUtils::getNameSpace(name, prefix); + getNameSpaceURIFromPrefix(prefix, nameSpaceURI); + +} //-- getNameSpaceURI + +/** + * Returns the namespace URI for the given namespace prefix +**/ +void ProcessorState::getNameSpaceURIFromPrefix(const String& prefix, String& nameSpaceURI) { + if (prefix.length() == 0) { nameSpaceURI.clear(); nameSpaceURI.append(*(String*)defaultNameSpaceURIStack.peek()); diff --git a/mozilla/extensions/transformiix/source/xslt/ProcessorState.h b/mozilla/extensions/transformiix/source/xslt/ProcessorState.h index 68439909976..adb22d70190 100644 --- a/mozilla/extensions/transformiix/source/xslt/ProcessorState.h +++ b/mozilla/extensions/transformiix/source/xslt/ProcessorState.h @@ -21,7 +21,7 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: ProcessorState.h,v 1.6 2000-09-04 16:25:27 axel%pike.org Exp $ + * $Id: ProcessorState.h,v 1.7 2000-11-07 10:46:03 kvisco%ziplink.net Exp $ */ @@ -50,11 +50,9 @@ /** * Class used for keeping the current state of the XSL Processor * @author Keith Visco - * @version $Revision: 1.6 $ $Date: 2000-09-04 16:25:27 $ + * @version $Revision: 1.7 $ $Date: 2000-11-07 10:46:03 $ **/ -class ProcessorState : public ContextState, - public NamespaceResolver -{ +class ProcessorState : public ContextState { public: @@ -293,6 +291,11 @@ public: **/ void getNameSpaceURI(const String& name, String& nameSpaceURI); + /** + * Returns the namespace URI for the given namespace prefix + **/ + void getNameSpaceURIFromPrefix(const String& prefix, String& nameSpaceURI); + private: enum XMLSpaceMode {STRIP = 0, DEFAULT, PRESERVE};