Commit 294dc77b authored by Peter.VanderBeken%pandora.be's avatar Peter.VanderBeken%pandora.be
Browse files

Use StringList (instead of hashmap) for namespace URIs. Not part of build yet. a=leaf.

parent 60b56b01
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -25,13 +25,13 @@
 *   -- added code in ::resolveFunctionCall to support the
 *      document() function.
 *
 * $Id: ProcessorState.cpp,v 1.4 2000/06/11 15:59:53 Peter.VanderBeken%pandora.be Exp $
 * $Id: ProcessorState.cpp,v 1.5 2000/06/22 07:30:03 Peter.VanderBeken%pandora.be Exp $
 */

/**
 * Implementation of ProcessorState
 * Much of this code was ported from XSL:P
 * @version $Revision: 1.4 $ $Date: 2000/06/11 15:59:53 $
 * @version $Revision: 1.5 $ $Date: 2000/06/22 07:30:03 $
**/

#include "ProcessorState.h"
@@ -484,16 +484,20 @@ void ProcessorState::preserveSpace(String& names) {
 * Sets a new default Namespace URI.
**/ 
void ProcessorState::setDefaultNameSpaceURI(const String& nsURI) {
    Int32 len = nsURI.length();
    unsigned long hashCode = 0;
    for (Int32 i = 0; i < len; i++) {
        hashCode +=  ((Int32)nsURI.charAt(i)) << 3;
    String* nsTempURIPointer = 0;
    String* nsURIPointer = 0;
    StringListIterator theIterator(&nameSpaceURIList);

    while (theIterator.hasNext()) {
        nsTempURIPointer = theIterator.next();
        if (nsTempURIPointer->isEqual(nsURI)) {
            nsURIPointer = nsTempURIPointer;
            break;
        }
    }

    String* nsURIPointer = (String*)nameSpaceURITable.retrieve(hashCode);
    if ( ! nsURIPointer ) {
        nsURIPointer = new String(nsURI);
        nameSpaceURITable.add(nsURIPointer, hashCode);
        nameSpaceURIList.add(nsURIPointer);
    }
    defaultNameSpaceURIStack.push(nsURIPointer);
} //-- setDefaultNameSpaceURI
+3 −3
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
 * Keith Visco, kvisco@ziplink.net
 *    -- original author.
 *
 * $Id: ProcessorState.h,v 1.3 2000/06/11 16:00:01 Peter.VanderBeken%pandora.be Exp $
 * $Id: ProcessorState.h,v 1.4 2000/06/22 07:30:07 Peter.VanderBeken%pandora.be Exp $
 */


@@ -50,7 +50,7 @@
/**
 * Class used for keeping the current state of the XSL Processor
 * @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
 * @version $Revision: 1.3 $ $Date: 2000/06/11 16:00:01 $
 * @version $Revision: 1.4 $ $Date: 2000/06/22 07:30:07 $
**/
class ProcessorState : public ContextState
{
@@ -360,7 +360,7 @@ private:
    ExprParser     exprParser;
    String         xsltNameSpace;
    NamedMap       nameSpaceMap;
    HashTable      nameSpaceURITable;
    StringList     nameSpaceURIList;
    Stack          defaultNameSpaceURIStack;

    //-- default templates