dbertoni    01/05/13 18:03:17

  Modified:    c/src/XSLT ElemAttribute.cpp ElemElement.cpp
                        ElemLiteralResult.cpp ElemTemplateElement.cpp
                        ElemTemplateElement.hpp
                        FunctionElementAvailable.cpp
                        FunctionFunctionAvailable.cpp
                        FunctionFunctionAvailable.hpp
                        FunctionSystemProperty.cpp NamespacesHandler.cpp
                        NamespacesHandler.hpp ResultNamespacesStack.cpp
                        ResultNamespacesStack.hpp Stylesheet.cpp
                        Stylesheet.hpp StylesheetExecutionContext.hpp
                        StylesheetExecutionContextDefault.cpp
                        StylesheetExecutionContextDefault.hpp
                        StylesheetHandler.cpp StylesheetHandler.hpp
                        XSLTEngineImpl.cpp XSLTEngineImpl.hpp
  Log:
  Return pointers to string instead of references for namespace-related 
functions, to support empty namespace URIs.
  
  Revision  Changes    Path
  1.23      +18 -8     xml-xalan/c/src/XSLT/ElemAttribute.cpp
  
  Index: ElemAttribute.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemAttribute.cpp,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- ElemAttribute.cpp 2001/03/09 16:20:08     1.22
  +++ ElemAttribute.cpp 2001/05/14 01:03:07     1.23
  @@ -199,15 +199,18 @@
   
                                // See if the namespace already exists.  If it 
does, we'll get the
                                // prefix that was used when it was declared.
  -                             const XalanDOMString&   prefix = 
executionContext.getResultPrefixForNamespace(attrNameSpace);
  +                             const XalanDOMString*  const    prefix =
  +                                     
executionContext.getResultPrefixForNamespace(attrNameSpace);
   
  -                             if(isEmpty(prefix) == false)
  +                             if(prefix != 0)
                                {
  +                                     assert(length(*prefix) != 0);
  +
                                        if(indexOfNSSep < origAttrNameLength)
                                        {
                                                reserve(
                                                        attrName,
  -                                                     length(attrName) - 
(indexOfNSSep + 1) + DOMServices::s_XMLNamespaceSeparatorStringLength + 
length(prefix) + 1);
  +                                                     length(attrName) - 
(indexOfNSSep + 1) + DOMServices::s_XMLNamespaceSeparatorStringLength + 
length(*prefix) + 1);
   
                                                assign(attrName, 
substring(attrName, indexOfNSSep + 1));
                                        }
  @@ -215,11 +218,11 @@
                                        {
                                                reserve(
                                                        attrName,
  -                                                     length(attrName) + 
DOMServices::s_XMLNamespaceSeparatorStringLength + length(prefix) + 1);
  +                                                     length(attrName) + 
DOMServices::s_XMLNamespaceSeparatorStringLength + length(*prefix) + 1);
                                        }
   
                                        insert(attrName, 0, 
DOMServices::s_XMLNamespaceSeparatorString);
  -                                     insert(attrName, 0, prefix);
  +                                     insert(attrName, 0, *prefix);
                                }
                                else
                                {
  @@ -299,8 +302,14 @@
                                        XalanDOMString&         nsprefix = 
nsprefixGuard.get();
   
                                        nsprefix = substring(origAttrName, 0, 
indexOfNSSep);
  +
  +                                     const XalanDOMString* const             
theNamespace =
  +                                             getNamespaceForPrefix(nsprefix);
   
  -                                     assign(attrNameSpace, 
getNamespaceForPrefix(nsprefix));
  +                                     if (theNamespace != 0)
  +                                     {
  +                                             assign(attrNameSpace, 
*theNamespace);
  +                                     }
   
                                        if (isEmpty(attrNameSpace))
                                        {
  @@ -310,9 +319,10 @@
                                        else
                                        {
                                                // Check to see if there's 
already a namespace declaration in scope...
  -                                             const XalanDOMString&   prefix 
= executionContext.getResultPrefixForNamespace(attrNameSpace);
  +                                             const XalanDOMString* const     
        prefix =
  +                                                     
executionContext.getResultPrefixForNamespace(attrNameSpace);
   
  -                                             if (length(prefix) == 0)
  +                                             if (prefix == 0)
                                                {
                                                        // We need to generate 
a namespace declaration...
                                                        
StylesheetExecutionContext::GetAndReleaseCachedString   
nsDeclGuard(executionContext);
  
  
  
  1.25      +59 -34    xml-xalan/c/src/XSLT/ElemElement.cpp
  
  Index: ElemElement.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemElement.cpp,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- ElemElement.cpp   2001/03/09 16:20:04     1.24
  +++ ElemElement.cpp   2001/05/14 01:03:07     1.25
  @@ -158,8 +158,19 @@
   
        m_nameAVT->evaluate(elemName, sourceNode, *this, executionContext);
   
  +     StylesheetExecutionContext::GetAndReleaseCachedString   
elemNameSpaceGuard(executionContext);
  +
  +     XalanDOMString&         elemNameSpace = elemNameSpaceGuard.get();
  +
  +     if (m_namespaceAVT != 0)
  +     {
  +             m_namespaceAVT->evaluate(elemNameSpace, sourceNode, *this, 
executionContext);
  +     }
  +
        bool                            isIllegalElement = false;
   
  +     bool                            hasUnresolvedPrefix = false;
  +
        unsigned int            len = length(elemName);
   
        const unsigned int      indexOfNSSep = indexOf(elemName, 
XalanUnicode::charColon);
  @@ -193,65 +204,79 @@
        {
                prefix = substring(elemName, 0, indexOfNSSep);
   
  -             const XalanDOMString&   theNamespace = 
executionContext.getResultNamespaceForPrefix(prefix);
  +             const XalanDOMString* const             theNamespace =
  +                     executionContext.getResultNamespaceForPrefix(prefix);
   
  -             if (length(theNamespace) == 0 && 
length(m_namespacesHandler.getNamespace(prefix)) == 0)
  +             if (theNamespace == 0)
                {
  -                     executionContext.warn("Could not resolve prefix: " + 
prefix, this, sourceNode);
  +                     const XalanDOMString* const             theNamespace =
  +                             m_namespacesHandler.getNamespace(prefix);
   
  -                     isIllegalElement = true;
  +                     if(theNamespace == 0 && isEmpty(elemNameSpace))
  +                     {
  +                             executionContext.warn("Could not resolve 
prefix: " + prefix, this, sourceNode);
  +
  +                             if (m_namespaceAVT != 0)
  +                             {
  +                                     hasUnresolvedPrefix = true;
  +
  +                                     elemName = substring(elemName, 
indexOfNSSep + 1);
  +                             }
  +                             else
  +                             {
  +                                     isIllegalElement = true;
  +                             }
  +                     }
                }
        }
   
        if (isIllegalElement == false)
        {
  -             if(0 == m_namespaceAVT)
  -             {
  -                     executionContext.startElement(c_wstr(elemName));   
  +             executionContext.startElement(c_wstr(elemName));   
   
  -                     
m_namespacesHandler.outputResultNamespaces(executionContext);
  +             m_namespacesHandler.outputResultNamespaces(executionContext);
   
  -                     // OK, now let's check to make sure we don't have to 
change the default namespace...
  -                     const XalanDOMString&   theCurrentDefaultNamespace =
  +             // OK, now let's check to make sure we don't have to change the 
default namespace...
  +             const XalanDOMString* const             
theCurrentDefaultNamespace =
                                
executionContext.getResultNamespaceForPrefix(s_emptyString);
   
  -                     const XalanDOMString&   theElementDefaultNamespace =
  -                             m_namespacesHandler.getNamespace(s_emptyString);
  -
  -                     if (equals(theCurrentDefaultNamespace, 
theElementDefaultNamespace) == false)
  -                     {
  -                             
executionContext.addResultAttribute(DOMServices::s_XMLNamespace, 
theElementDefaultNamespace);
  -                     }
  -             }
  -             else
  +             if (theCurrentDefaultNamespace != 0)
                {
  -                     StylesheetExecutionContext::GetAndReleaseCachedString   
elemNameSpaceGuard(executionContext);
  -
  -                     XalanDOMString&         elemNameSpace = 
elemNameSpaceGuard.get();
  -
  -                     m_namespaceAVT->evaluate(elemNameSpace, sourceNode, 
*this, executionContext);
  +                     const XalanDOMString* const             
theElementDefaultNamespace =
  +                                     
m_namespacesHandler.getNamespace(s_emptyString);
   
  -                     if(isEmpty(elemNameSpace) == true)
  +                     if (hasUnresolvedPrefix == true || 
theElementDefaultNamespace == 0)
                        {
  -                             
executionContext.startElement(c_wstr(elemName));   
  -
  -                             
m_namespacesHandler.outputResultNamespaces(executionContext);
  +                             // There was no default namespace, so we have 
to turn the
  +                             // current one off.
  +                             
executionContext.addResultAttribute(DOMServices::s_XMLNamespace, s_emptyString);
                        }
  -                     else
  +                     else if (equals(*theCurrentDefaultNamespace, 
*theElementDefaultNamespace) == false)
                        {
  -                             executionContext.startElement(c_wstr(elemName));
  -
  -                             
m_namespacesHandler.outputResultNamespaces(executionContext);
  +                             
executionContext.addResultAttribute(DOMServices::s_XMLNamespace, 
*theElementDefaultNamespace);
  +                     }
  +             }
   
  +             if(0 != m_namespaceAVT)
  +             {
  +                     if(isEmpty(elemNameSpace) == false || 
hasUnresolvedPrefix == false)
  +                     {
                                if(indexOfNSSep == len)
                                {
                                        
executionContext.addResultAttribute(DOMServices::s_XMLNamespace, elemNameSpace);
                                }
                                else
                                {
  -                                     insert(prefix, 0, 
DOMServices::s_XMLNamespaceWithSeparator);
  +                                     const XalanDOMString* const             
theNamespace =
  +                                             
executionContext.getResultNamespaceForPrefix(prefix);
  +
  +                                     if (theNamespace == 0 ||
  +                                             equals(*theNamespace, 
elemNameSpace) == false)
  +                                     {
  +                                             insert(prefix, 0, 
DOMServices::s_XMLNamespaceWithSeparator);
   
  -                                     
executionContext.addResultAttribute(prefix, elemNameSpace);
  +                                             
executionContext.addResultAttribute(prefix, elemNameSpace);
  +                                     }
                                }
                        }
                }
  
  
  
  1.36      +26 -4     xml-xalan/c/src/XSLT/ElemLiteralResult.cpp
  
  Index: ElemLiteralResult.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemLiteralResult.cpp,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- ElemLiteralResult.cpp     2001/05/11 18:16:33     1.35
  +++ ElemLiteralResult.cpp     2001/05/14 01:03:08     1.36
  @@ -123,9 +123,10 @@
   
                        if(!equals(prefix, DOMServices::s_XMLNamespace))
                        {
  -                             const XalanDOMString&   ns = 
getNamespaceForPrefixInternal(prefix, true);
  +                             const XalanDOMString* const             ns =
  +                                             
getNamespaceForPrefixInternal(prefix, true);
   
  -                             if(equals(ns, 
stylesheetTree.getXSLTNamespaceURI()))
  +                             if(ns != 0 && equals(*ns, 
stylesheetTree.getXSLTNamespaceURI()))
                                {
                                        const XalanDOMString localName = 
substring(aname, indexOfNSSep + 1);
   
  @@ -233,6 +234,27 @@
   
        m_namespacesHandler.outputResultNamespaces(executionContext);
   
  +     // OK, now let's check to make sure we don't have to change the default 
namespace...
  +     const XalanDOMString* const             theCurrentDefaultNamespace =
  +                             
executionContext.getResultNamespaceForPrefix(s_emptyString);
  +
  +     if (theCurrentDefaultNamespace != 0)
  +     {
  +             const XalanDOMString* const             
theElementDefaultNamespace =
  +                                     
m_namespacesHandler.getNamespace(s_emptyString);
  +
  +             if (theElementDefaultNamespace == 0)
  +             {
  +                     // There was no default namespace, so we have to turn 
the
  +                     // current one off.
  +                     
executionContext.addResultAttribute(DOMServices::s_XMLNamespace, s_emptyString);
  +             }
  +             else if (equals(*theCurrentDefaultNamespace, 
*theElementDefaultNamespace) == false)
  +             {
  +                     
executionContext.addResultAttribute(DOMServices::s_XMLNamespace, 
*theElementDefaultNamespace);
  +             }
  +     }
  +
        if(0 != m_avts.size())
        {
                const AVTVectorType::size_type  nAttrs = m_avts.size();
  @@ -310,9 +332,9 @@
                {
                        const XalanDOMString    prefix = substring(attrName, 0, 
indexOfNSSep);
   
  -                     const XalanDOMString&   ns = 
getStylesheet().getNamespaceForPrefixFromStack(prefix);
  +                     const XalanDOMString* const             ns = 
getStylesheet().getNamespaceForPrefixFromStack(prefix);
   
  -                     if (equals(ns, 
constructionContext.getXSLTNamespaceURI()) == false)
  +                     if (ns != 0 && equals(*ns, 
constructionContext.getXSLTNamespaceURI()) == false)
                        {
                                isAttrOK = true;
                        }
  
  
  
  1.56      +13 -11    xml-xalan/c/src/XSLT/ElemTemplateElement.cpp
  
  Index: ElemTemplateElement.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemTemplateElement.cpp,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- ElemTemplateElement.cpp   2001/05/10 17:58:07     1.55
  +++ ElemTemplateElement.cpp   2001/05/14 01:03:08     1.56
  @@ -1421,7 +1421,7 @@
   
   
   
  -const XalanDOMString&
  +const XalanDOMString*
   ElemTemplateElement::getNamespaceForPrefix(const XalanDOMString&     prefix) 
const
   {
        return getNamespaceForPrefixInternal(prefix, false);
  @@ -1429,12 +1429,12 @@
   
   
   
  -const XalanDOMString&
  +const XalanDOMString*
   ElemTemplateElement::getNamespaceForPrefixInternal(
                        const XalanDOMString&   prefix,
                        bool                                    fReportError) 
const
   {
  -    const XalanDOMString*    nameSpace = &DOMServices::s_emptyString;
  +    const XalanDOMString*    nameSpace = 0;
   
        if (isEmpty(prefix) == false)
        {
  @@ -1452,35 +1452,37 @@
                        }
                        else
                        {
  -                             nameSpace = 
&getNamespacesHandler().getNamespace(prefix);
  +                             nameSpace = 
getNamespacesHandler().getNamespace(prefix);
   
  -                             if(isEmpty(*nameSpace) == true)
  +                             if(nameSpace == 0)
                                {
                                        if (m_parentNode != 0)
                                        {
  -                                             nameSpace = 
&m_parentNode->getNamespaceForPrefixInternal(prefix, false);
  +                                             nameSpace = 
m_parentNode->getNamespaceForPrefixInternal(prefix, false);
                                        }
   
                                        // Try one last time with the 
stylesheet...
  -                                     if(isEmpty(*nameSpace) == true)
  +                                     if (nameSpace == 0)
                                        {
  -                                             nameSpace = 
&getStylesheet().getNamespaceForPrefix(prefix);
  +                                             nameSpace = 
getStylesheet().getNamespaceForPrefix(prefix);
                                        }
                                }
                        }
                }
                else
                {
  -                     nameSpace = 
&getStylesheet().getNamespaceForPrefixFromStack(prefix);
  +                     nameSpace = 
getStylesheet().getNamespaceForPrefixFromStack(prefix);
                }
   
  -             if(fReportError == true && fEmptyIsError == true && 
isEmpty(*nameSpace) == true)
  +             if(fReportError == true &&
  +                fEmptyIsError == true &&
  +                nameSpace == 0)
                {
                        error("Cannot resolve namespace prefix: " + prefix);
                }
        }
   
  -    return *nameSpace;
  +    return nameSpace;
   }
   
   
  
  
  
  1.29      +2 -2      xml-xalan/c/src/XSLT/ElemTemplateElement.hpp
  
  Index: ElemTemplateElement.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemTemplateElement.hpp,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- ElemTemplateElement.hpp   2001/05/10 17:58:09     1.28
  +++ ElemTemplateElement.hpp   2001/05/14 01:03:09     1.29
  @@ -627,7 +627,7 @@
   
        // These interfaces are inherited from PrefixResolver...
   
  -     virtual const XalanDOMString&
  +     virtual const XalanDOMString*
        getNamespaceForPrefix(const XalanDOMString& prefix) const;
   
        virtual const XalanDOMString&
  @@ -642,7 +642,7 @@
         * @param fReportError If true, and exception will be thrown to report 
the error.
         * @return The namespace string.
         */
  -     const XalanDOMString&
  +     const XalanDOMString*
        getNamespaceForPrefixInternal(
                        const XalanDOMString&   prefix,
                        bool                                    fReportError) 
const;
  
  
  
  1.12      +7 -5      xml-xalan/c/src/XSLT/FunctionElementAvailable.cpp
  
  Index: FunctionElementAvailable.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionElementAvailable.cpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- FunctionElementAvailable.cpp      2000/12/06 21:19:22     1.11
  +++ FunctionElementAvailable.cpp      2001/05/14 01:03:09     1.12
  @@ -103,11 +103,13 @@
        const unsigned int              nameLength = length(fullName);
        const unsigned int              indexOfNSSep = indexOf(fullName, 
XalanUnicode::charColon);
   
  -     const XalanDOMString    prefix = indexOfNSSep < nameLength ? 
substring(fullName, 0, indexOfNSSep) : XalanDOMString();
  +     const XalanDOMString                    prefix =
  +             indexOfNSSep < nameLength ? substring(fullName, 0, 
indexOfNSSep) : XalanDOMString();
   
  -     const XalanDOMString&   theNamespace = 
executionContext.getNamespaceForPrefix(prefix);
  +     const XalanDOMString* const             theNamespace =
  +             executionContext.getNamespaceForPrefix(prefix);
   
  -     if (length(theNamespace) == 0)
  +     if (theNamespace == 0 || length(*theNamespace) == 0)
        {
                return 
executionContext.getXObjectFactory().createBoolean(false);
        }
  @@ -115,13 +117,13 @@
        {
                if (indexOfNSSep == nameLength)
                {
  -                     return 
executionContext.getXObjectFactory().createBoolean(executionContext.elementAvailable(theNamespace,
 fullName));
  +                     return 
executionContext.getXObjectFactory().createBoolean(executionContext.elementAvailable(*theNamespace,
 fullName));
                }
                else
                {
                        const XalanDOMString    elementName =  
substring(fullName, indexOfNSSep + 1);
   
  -                     return 
executionContext.getXObjectFactory().createBoolean(executionContext.elementAvailable(theNamespace,
 elementName));
  +                     return 
executionContext.getXObjectFactory().createBoolean(executionContext.elementAvailable(*theNamespace,
 elementName));
                }
        }
   }
  
  
  
  1.11      +14 -3     xml-xalan/c/src/XSLT/FunctionFunctionAvailable.cpp
  
  Index: FunctionFunctionAvailable.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionFunctionAvailable.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- FunctionFunctionAvailable.cpp     2000/12/06 21:19:28     1.10
  +++ FunctionFunctionAvailable.cpp     2001/05/14 01:03:09     1.11
  @@ -66,6 +66,10 @@
   
   
   
  +const XalanDOMString FunctionFunctionAvailable::s_emptyString;
  +
  +
  +
   FunctionFunctionAvailable::FunctionFunctionAvailable()
   {
   }
  @@ -104,12 +108,19 @@
        const unsigned int              indexOfNSSep = indexOf(fullName, 
XalanUnicode::charColon);
   
        const XalanDOMString    prefix = indexOfNSSep < nameLength ? 
substring(fullName, 0, indexOfNSSep) : XalanDOMString();
  +
  +     const XalanDOMString*   theNamespace =
  +                     executionContext.getNamespaceForPrefix(prefix);
   
  -     const XalanDOMString&   theNamespace = 
executionContext.getNamespaceForPrefix(prefix);
  +     if (theNamespace == 0)
  +     {
  +             theNamespace = &s_emptyString;
  +     }
   
  -     const XalanDOMString    functionName = indexOfNSSep == nameLength ? 
fullName : substring(fullName, indexOfNSSep + 1);
  +     const XalanDOMString    functionName =
  +                     indexOfNSSep == nameLength ? fullName : 
substring(fullName, indexOfNSSep + 1);
   
  -     return 
executionContext.getXObjectFactory().createBoolean(executionContext.functionAvailable(theNamespace,
 functionName));
  +     return 
executionContext.getXObjectFactory().createBoolean(executionContext.functionAvailable(*theNamespace,
 functionName));
   }
   
   
  
  
  
  1.5       +2 -0      xml-xalan/c/src/XSLT/FunctionFunctionAvailable.hpp
  
  Index: FunctionFunctionAvailable.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionFunctionAvailable.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FunctionFunctionAvailable.hpp     2000/12/06 21:19:30     1.4
  +++ FunctionFunctionAvailable.hpp     2001/05/14 01:03:09     1.5
  @@ -142,6 +142,8 @@
   
        bool
        operator==(const FunctionFunctionAvailable&) const;
  +
  +     static const XalanDOMString             s_emptyString;
   };
   
   
  
  
  
  1.17      +25 -22    xml-xalan/c/src/XSLT/FunctionSystemProperty.cpp
  
  Index: FunctionSystemProperty.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionSystemProperty.cpp,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- FunctionSystemProperty.cpp        2000/12/06 21:19:36     1.16
  +++ FunctionSystemProperty.cpp        2001/05/14 01:03:10     1.17
  @@ -120,36 +120,39 @@
        {
                const XalanDOMString    prefix = substring(fullName, 0, 
indexOfNSSep);
   
  -             const XalanDOMString&   nspace = 
executionContext.getNamespaceForPrefix(prefix);
  +             const XalanDOMString* const             nspace = 
executionContext.getNamespaceForPrefix(prefix);
   
  -             const XalanDOMString    propName = substring(fullName, 
indexOfNSSep + 1);
  -
  -             if(startsWith(nspace, 
XALAN_STATIC_UCODE_STRING("http://www.w3.org/1999/XSL/Transform";)))
  +             if (nspace != 0)
                {
  -                     if(equals(propName, 
XALAN_STATIC_UCODE_STRING("version")))
  -                     {
  -                             numberResult = 1.0;
  +                     const XalanDOMString    propName = substring(fullName, 
indexOfNSSep + 1);
   
  -                             fNumberResult = true;
  -                     }
  -                     else if(equals(propName, 
XALAN_STATIC_UCODE_STRING("vendor")))
  -                     {
  -                             result = XALAN_STATIC_UCODE_STRING("Apache 
Software Foundation");
  -                     }
  -                     else if(equals(propName, 
XALAN_STATIC_UCODE_STRING("vendor-url")))
  +                     if(startsWith(*nspace, 
XALAN_STATIC_UCODE_STRING("http://www.w3.org/1999/XSL/Transform";)))
                        {
  -                             result = 
XALAN_STATIC_UCODE_STRING("http://xml.apache.org/xalan-c";);
  +                             if(equals(propName, 
XALAN_STATIC_UCODE_STRING("version")))
  +                             {
  +                                     numberResult = 1.0;
  +
  +                                     fNumberResult = true;
  +                             }
  +                             else if(equals(propName, 
XALAN_STATIC_UCODE_STRING("vendor")))
  +                             {
  +                                     result = 
XALAN_STATIC_UCODE_STRING("Apache Software Foundation");
  +                             }
  +                             else if(equals(propName, 
XALAN_STATIC_UCODE_STRING("vendor-url")))
  +                             {
  +                                     result = 
XALAN_STATIC_UCODE_STRING("http://xml.apache.org/xalan-c";);
  +                             }
  +                             else
  +                             {
  +                                     executionContext.warn("XSL Property not 
supported: " + fullName);
  +                             }
                        }
                        else
                        {
  -                             executionContext.warn("XSL Property not 
supported: " + fullName);
  -                     }
  -             }
  -             else
  -             {
  -                     executionContext.warn("Don't currently do anything with 
namespace " + nspace + " in property: " + fullName);
  +                             executionContext.warn("Don't currently do 
anything with namespace " + *nspace + " in property: " + fullName);
   
  -                     result = 
TranscodeFromLocalCodePage(::getenv(c_str(TranscodeToLocalCodePage(propName))));
  +                             result = 
TranscodeFromLocalCodePage(::getenv(c_str(TranscodeToLocalCodePage(propName))));
  +                     }
                }
        }
        else
  
  
  
  1.9       +38 -32    xml-xalan/c/src/XSLT/NamespacesHandler.cpp
  
  Index: NamespacesHandler.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/NamespacesHandler.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- NamespacesHandler.cpp     2001/05/11 18:16:41     1.8
  +++ NamespacesHandler.cpp     2001/05/14 01:03:10     1.9
  @@ -164,7 +164,7 @@
   
   
   
  -const XalanDOMString&
  +const XalanDOMString*
   NamespacesHandler::getNamespace(const XalanDOMString&        thePrefix) const
   {
        // Check the excluded result prefixes first...
  @@ -173,7 +173,7 @@
   
        if (i != m_excludedResultPrefixes.end())
        {
  -             return (*i).second;
  +             return &(*i).second;
        }
        else
        {
  @@ -183,11 +183,11 @@
   
                if (i != m_namespaceDeclarations.end())
                {
  -                     return (*i).second.getURI();
  +                     return &(*i).second.getURI();
                }
                else
                {
  -                     return s_dummyEmptyString;
  +                     return 0;
                }
        }
   }
  @@ -202,12 +202,12 @@
   
   
   
  -const XalanDOMString&
  +const XalanDOMString*
   NamespacesHandler::getNamespaceAlias(const XalanDOMString&           
theStylesheetNamespace) const
   {
        if (m_namespaceAliases.size() == 0)
        {
  -             return s_dummyEmptyString;
  +             return 0;
        }
        else
        {
  @@ -216,11 +216,11 @@
   
                if (i != m_namespaceAliases.end())
                {
  -                     return (*i).second;
  +                     return &(*i).second;
                }
                else
                {
  -                     return s_dummyEmptyString;
  +                     return 0;
                }
        }
   }
  @@ -246,10 +246,10 @@
                        ::clear(thePrefix);
                }
   
  -             const XalanDOMString&   theNamespace =
  +             const XalanDOMString* const             theNamespace =
                        QName::getNamespaceForPrefix(theCurrentNamespaces, 
thePrefix);
   
  -             if(length(theNamespace) == 0)
  +             if(theNamespace == 0)
                {
                        XalanDOMString  
theMessage(TranscodeFromLocalCodePage("Invalid prefix in 
exclude-result-prefixes: "));
   
  @@ -258,7 +258,7 @@
                        theConstructionContext.error(theMessage);
                }
   
  -             m_excludedResultPrefixes[thePrefix] = theNamespace;
  +             m_excludedResultPrefixes[thePrefix] = *theNamespace;
       }
   }
   
  @@ -283,10 +283,10 @@
                        ::clear(thePrefix);
                }
   
  -             const XalanDOMString&   theNamespace =
  +             const XalanDOMString* const             theNamespace =
                        QName::getNamespaceForPrefix(theCurrentNamespaces, 
thePrefix);
   
  -             if(length(theNamespace) == 0)
  +             if(theNamespace == 0)
                {
                        XalanDOMString  
theMessage(TranscodeFromLocalCodePage("Invalid prefix in 
extension-element-prefixes: "));
   
  @@ -295,7 +295,7 @@
                        theConstructionContext.error(theMessage);
                }
   
  -             m_extensionNamespaceURIs.insert(theNamespace);
  +             m_extensionNamespaceURIs.insert(*theNamespace);
       }
   }
   
  @@ -384,7 +384,9 @@
   
   
   void
  -NamespacesHandler::outputResultNamespaces(StylesheetExecutionContext&        
theExecutionContext) const
  +NamespacesHandler::outputResultNamespaces(
  +                     StylesheetExecutionContext&             
theExecutionContext,
  +                     const XalanDOMString*                   
theNamespaceToExclude) const
   {
        // Write out the namespace declarations...
        if (m_namespaceDeclarations.size() > 0)
  @@ -402,18 +404,22 @@
                        const XalanDOMString&           theResultURI = 
theNamespace.getURI();
                        assert(length(theNamespace.getResultAttributeName()) > 
0);
   
  -                     const XalanDOMString&           thePrefix = 
theNamespace.getPrefix();
  -
  -                     // Get the any namespace declaration currently active 
for the
  -                     // prefix.
  -                     const XalanDOMString&           desturi =
  -                             
theExecutionContext.getResultNamespaceForPrefix(thePrefix);
  -
  -                     // Is there already an active namespace declaration?
  -                     if(!equals(theResultURI, desturi))
  +//                   if (theNamespaceToExclude == 0 ||
  +//                           equals(*theNamespaceToExclude, theResultURI) == 
false)
                        {
  -                             // No, so add one...
  -                             
theExecutionContext.addResultAttribute(theNamespace.getResultAttributeName(), 
theResultURI);
  +                             const XalanDOMString&           thePrefix = 
theNamespace.getPrefix();
  +
  +                             // Get the any namespace declaration currently 
active for the
  +                             // prefix.
  +                             const XalanDOMString* const             desturi 
=
  +                                     
theExecutionContext.getResultNamespaceForPrefix(thePrefix);
  +
  +                             // Is there already an active namespace 
declaration?
  +                             if(desturi == 0 || !equals(theResultURI, 
*desturi))
  +                             {
  +                                     // No, so add one...
  +                                     
theExecutionContext.addResultAttribute(theNamespace.getResultAttributeName(), 
theResultURI);
  +                             }
                        }
                }
        }
  @@ -592,15 +598,17 @@
                {
                        NameSpace&      theNamespace = (*i).second;
   
  -                     const XalanDOMString&   theURI = theNamespace.getURI();
  +                     const XalanDOMString&                   theURI =
  +                                             theNamespace.getURI();
   
  -                     const XalanDOMString&   theAlias = 
getNamespaceAlias(theURI);
  +                     const XalanDOMString* const             theAlias =
  +                                             getNamespaceAlias(theURI);
   
                        // Is there a local alias?
  -                     if (length(theAlias) != 0)
  +                     if (theAlias != 0)
                        {
                                // Yup, so use it...
  -                             theNamespace.setURI(theAlias);
  +                             theNamespace.setURI(*theAlias);
                        }
                }
        }
  @@ -713,8 +721,6 @@
   
   const XalanDOMString&        
NamespacesHandler::s_LotusXSLTNamespaceURIWithSeparator =
                                                        
::s_LotusXSLTNamespaceURIWithSeparator;
  -
  -const XalanDOMString NamespacesHandler::s_dummyEmptyString;
   
   
   
  
  
  
  1.7       +5 -5      xml-xalan/c/src/XSLT/NamespacesHandler.hpp
  
  Index: NamespacesHandler.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/NamespacesHandler.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- NamespacesHandler.hpp     2001/05/11 18:16:45     1.6
  +++ NamespacesHandler.hpp     2001/05/14 01:03:10     1.7
  @@ -301,7 +301,7 @@
         * @param thePrefix The namespace prefix.
         * @return The namespace URI
         */
  -     const XalanDOMString&
  +     const XalanDOMString*
        getNamespace(const XalanDOMString&      thePrefix) const;
   
        /**
  @@ -310,7 +310,7 @@
         * @param theStylesheetNamespace The namespace as declared in the 
stylesheet.
         * @return The namespace alias URI
         */
  -     const XalanDOMString&
  +     const XalanDOMString*
        getNamespaceAlias(const XalanDOMString&         theStylesheetNamespace) 
const;
   
        /**
  @@ -352,7 +352,9 @@
         * @param theExecutionContext The current execution context.
         */
        void
  -     outputResultNamespaces(StylesheetExecutionContext&      
theExecutionContext) const;
  +     outputResultNamespaces(
  +                     StylesheetExecutionContext&             
theExecutionContext,
  +                     const XalanDOMString*                   
theNamespaceToExclude = 0) const;
   
        /**
         * Clear out the handler.
  @@ -458,8 +460,6 @@
   
        // If true namespace aliases will be processed.  If false, they will 
not.
        bool                                                    
m_processAliases;
  -
  -     const static XalanDOMString             s_dummyEmptyString;
   };
   
   
  
  
  
  1.4       +2 -2      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ResultNamespacesStack.cpp 2001/05/11 18:18:00     1.3
  +++ ResultNamespacesStack.cpp 2001/05/14 01:03:10     1.4
  @@ -142,7 +142,7 @@
   
   
   
  -const XalanDOMString&
  +const XalanDOMString*
   ResultNamespacesStack::getNamespaceForPrefix(const XalanDOMString&   
thePrefix) const
   {
        // Search vector from first element back
  @@ -151,7 +151,7 @@
   
   
   
  -const XalanDOMString&
  +const XalanDOMString*
   ResultNamespacesStack::getPrefixForNamespace(const XalanDOMString&   
theNamespaceURI) const
   {
        // Search vector from first element back
  
  
  
  1.4       +2 -2      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ResultNamespacesStack.hpp 2001/01/30 22:02:43     1.3
  +++ ResultNamespacesStack.hpp 2001/05/14 01:03:11     1.4
  @@ -108,10 +108,10 @@
        void
        popContext();
   
  -     const XalanDOMString&
  +     const XalanDOMString*
        getNamespaceForPrefix(const XalanDOMString&             thePrefix) 
const;
   
  -     const XalanDOMString&
  +     const XalanDOMString*
        getPrefixForNamespace(const XalanDOMString&             
theNamespaceURI) const;
   
   
  
  
  
  1.54      +12 -12    xml-xalan/c/src/XSLT/Stylesheet.cpp
  
  Index: Stylesheet.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/Stylesheet.cpp,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- Stylesheet.cpp    2001/04/30 18:12:50     1.53
  +++ Stylesheet.cpp    2001/05/14 01:03:11     1.54
  @@ -166,7 +166,7 @@
                                m_includeStack.push_back(urlString);
                        }
                }
  -             catch(const XMLException&       e)
  +             catch(const XMLException&)
                {
                        // Assume that any exception here relates to get the 
urlString from
                        // m_baseIdent.  We'll assume that it's just a fake 
base identifier
  @@ -396,9 +396,9 @@
                if(indexOfNSSep < length(attrName))
                {
                        const XalanDOMString    prefix = substring(attrName, 0, 
indexOfNSSep);
  -                     const XalanDOMString&   ns = 
getNamespaceForPrefixFromStack(prefix);
  +                     const XalanDOMString*   ns = 
getNamespaceForPrefixFromStack(prefix);
   
  -                     attrOK = ! ::isEmpty(ns) && 
!equals(ns,constructionContext.getXSLTNamespaceURI());
  +                     attrOK = ns != 0 && !::isEmpty(*ns) && !equals(*ns, 
constructionContext.getXSLTNamespaceURI());
                }
                else
                {
  @@ -411,7 +411,7 @@
   
   
   
  -const XalanDOMString&
  +const XalanDOMString*
   Stylesheet::getNamespaceFromStack(const XalanDOMString&              
nodeName) const
   {
        return getNamespaceFromStack(c_wstr(nodeName));
  @@ -419,7 +419,7 @@
   
   
   
  -const XalanDOMString&
  +const XalanDOMString*
   Stylesheet::getNamespaceFromStack(const XalanDOMChar*        nodeName) const
   {
        assert(nodeName != 0);
  @@ -436,7 +436,7 @@
   
   
   
  -const XalanDOMString&
  +const XalanDOMString*
   Stylesheet::getNamespaceForPrefix(const XalanDOMString&      prefix) const
   {
        return QName::getNamespaceForPrefix(m_namespaceDecls, prefix);
  @@ -444,7 +444,7 @@
   
   
   
  -const XalanDOMString&
  +const XalanDOMString*
   Stylesheet::getNamespaceForPrefixFromStack(const XalanDOMString&     prefix) 
const
   {
        return QName::getNamespaceForPrefix(m_namespaces, prefix);
  @@ -452,7 +452,7 @@
   
   
   
  -const XalanDOMString&
  +const XalanDOMString*
   Stylesheet::getNamespaceForPrefixFromStack(const XalanDOMChar*       prefix) 
const
   {
        assert(prefix != 0);
  @@ -1223,11 +1223,11 @@
   
                        if (equals(value, Constants::ATTRVAL_DEFAULT_PREFIX) == 
true)
                        {
  -                             stylesheetNamespace = 
&getNamespaceForPrefix(dummy);
  +                             stylesheetNamespace = 
getNamespaceForPrefix(dummy);
                        }
                        else
                        {
  -                             stylesheetNamespace = 
&getNamespaceForPrefix(XalanDOMString(value));
  +                             stylesheetNamespace = 
getNamespaceForPrefix(XalanDOMString(value));
                        }
                }
                else if(equals(aname, Constants::ATTRNAME_RESULT_PREFIX))
  @@ -1236,11 +1236,11 @@
   
                        if (equals(value, Constants::ATTRVAL_DEFAULT_PREFIX) == 
true)
                        {
  -                             resultNamespace = &getNamespaceForPrefix(dummy);
  +                             resultNamespace = getNamespaceForPrefix(dummy);
                        }
                        else
                        {
  -                             resultNamespace = 
&getNamespaceForPrefix(XalanDOMString(value));
  +                             resultNamespace = 
getNamespaceForPrefix(XalanDOMString(value));
                        }
                }
                else if(!isAttrOK(aname, atts, i, constructionContext))
  
  
  
  1.35      +9 -9      xml-xalan/c/src/XSLT/Stylesheet.hpp
  
  Index: Stylesheet.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/Stylesheet.hpp,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- Stylesheet.hpp    2001/04/18 20:03:46     1.34
  +++ Stylesheet.hpp    2001/05/14 01:03:11     1.35
  @@ -336,18 +336,18 @@
         * Get the namespace from a qualified name.
         * 
         * @param nodeName name of node
  -      * @return namespace string for node
  +      * @return namespace string for node, or null if not found.
         */
  -     const XalanDOMString&
  +     const XalanDOMString*
        getNamespaceFromStack(const XalanDOMString&     nodeName) const;
   
        /**
         * Get the namespace from a qualified name.
         * 
         * @param nodeName name of node
  -      * @return namespace string for node
  +      * @return namespace string for node, or null if not found.
         */
  -     const XalanDOMString&
  +     const XalanDOMString*
        getNamespaceFromStack(const XalanDOMChar*       nodeName) const;
   
        /**
  @@ -355,9 +355,9 @@
         * lists.
         * 
         * @param prefix prefix to search
  -      * @return namespace corresponding to prefix
  +      * @return namespace corresponding to prefix, or null if not found.
         */
  -     const XalanDOMString&
  +     const XalanDOMString*
        getNamespaceForPrefixFromStack(const XalanDOMString&    prefix) const;
   
        /**
  @@ -365,9 +365,9 @@
         * lists.
         * 
         * @param prefix prefix to search
  -      * @return namespace corresponding to prefix
  +      * @return namespace corresponding to prefix, or null if not found.
         */
  -     const XalanDOMString&
  +     const XalanDOMString*
        getNamespaceForPrefixFromStack(const XalanDOMChar*      prefix) const;
   
        /**
  @@ -1104,7 +1104,7 @@
   
        // These interfaces are inherited from PrefixResolver...
   
  -     virtual const XalanDOMString&
  +     virtual const XalanDOMString*
        getNamespaceForPrefix(const XalanDOMString&     prefix) const;
   
        virtual const XalanDOMString&
  
  
  
  1.54      +3 -3      xml-xalan/c/src/XSLT/StylesheetExecutionContext.hpp
  
  Index: StylesheetExecutionContext.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContext.hpp,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- StylesheetExecutionContext.hpp    2001/05/10 18:45:21     1.53
  +++ StylesheetExecutionContext.hpp    2001/05/14 01:03:11     1.54
  @@ -360,7 +360,7 @@
         * 
         * @param theNamespace namespace for prefix
         */
  -     virtual const XalanDOMString&
  +     virtual const XalanDOMString*
        getResultPrefixForNamespace(const XalanDOMString&       theNamespace) 
const = 0;
   
        /**
  @@ -368,7 +368,7 @@
         * 
         * @param thePrefix prefix for namespace
         */
  -     virtual const XalanDOMString&
  +     virtual const XalanDOMString*
        getResultNamespaceForPrefix(const XalanDOMString&       thePrefix) 
const = 0;
   
        /**
  @@ -1631,7 +1631,7 @@
        virtual void
        setPrefixResolver(const PrefixResolver*         thePrefixResolver) = 0;
   
  -     virtual const XalanDOMString&
  +     virtual const XalanDOMString*
        getNamespaceForPrefix(const XalanDOMString&             prefix) const = 
0;
   
        virtual XalanDOMString
  
  
  
  1.65      +4 -5      
xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp
  
  Index: StylesheetExecutionContextDefault.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- StylesheetExecutionContextDefault.cpp     2001/05/10 18:45:22     1.64
  +++ StylesheetExecutionContextDefault.cpp     2001/05/14 01:03:11     1.65
  @@ -390,9 +390,8 @@
   
   
   
  -const XalanDOMString&
  -StylesheetExecutionContextDefault::getResultPrefixForNamespace(
  -                     const XalanDOMString&   theNamespace) const
  +const XalanDOMString*
  +StylesheetExecutionContextDefault::getResultPrefixForNamespace(const 
XalanDOMString& theNamespace) const
   {
        assert(m_xsltProcessor != 0);
   
  @@ -401,7 +400,7 @@
   
   
   
  -const XalanDOMString&
  +const XalanDOMString*
   StylesheetExecutionContextDefault::getResultNamespaceForPrefix(const 
XalanDOMString& thePrefix) const
   {
        assert(m_xsltProcessor != 0);
  @@ -1699,7 +1698,7 @@
   
   
   
  -const XalanDOMString&
  +const XalanDOMString*
   StylesheetExecutionContextDefault::getNamespaceForPrefix(const 
XalanDOMString&       prefix) const
   {
        return m_xpathExecutionContextDefault.getNamespaceForPrefix(prefix);
  
  
  
  1.59      +3 -3      
xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.hpp
  
  Index: StylesheetExecutionContextDefault.hpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.hpp,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- StylesheetExecutionContextDefault.hpp     2001/05/10 18:45:23     1.58
  +++ StylesheetExecutionContextDefault.hpp     2001/05/14 01:03:12     1.59
  @@ -317,10 +317,10 @@
        virtual void
        copyNamespaceAttributes(const XalanNode&        src);
   
  -     virtual const XalanDOMString&
  +     virtual const XalanDOMString*
        getResultPrefixForNamespace(const XalanDOMString&       theNamespace) 
const;
   
  -     virtual const XalanDOMString&
  +     virtual const XalanDOMString*
        getResultNamespaceForPrefix(const XalanDOMString&       thePrefix) 
const;
   
        virtual XalanDOMString
  @@ -834,7 +834,7 @@
        virtual void
        setPrefixResolver(const PrefixResolver*         thePrefixResolver);
   
  -     virtual const XalanDOMString&
  +     virtual const XalanDOMString*
        getNamespaceForPrefix(const XalanDOMString&             prefix) const;
   
        virtual XalanDOMString
  
  
  
  1.64      +44 -5     xml-xalan/c/src/XSLT/StylesheetHandler.cpp
  
  Index: StylesheetHandler.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetHandler.cpp,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- StylesheetHandler.cpp     2001/05/02 15:55:57     1.63
  +++ StylesheetHandler.cpp     2001/05/14 01:03:12     1.64
  @@ -128,7 +128,10 @@
   #include <Include/XalanAutoPtr.hpp>
   
   
  +const XalanDOMString StylesheetHandler::s_emptyString;
   
  +
  +
   StylesheetHandler::StylesheetHandler(
                        Stylesheet&                                             
stylesheetTree,
                        StylesheetConstructionContext&  constructionContext) :
  @@ -357,7 +360,7 @@
                // First push namespaces
                m_stylesheet.pushNamespaces(atts);
   
  -             const XalanDOMString&   ns = 
m_stylesheet.getNamespaceFromStack(name);
  +             const XalanDOMString&   ns = getNamespaceFromStack(name);
   
                const unsigned int              nameLength = length(name);
                const unsigned int              index = indexOf(name, 
XalanUnicode::charColon);
  @@ -654,10 +657,10 @@
                        {
                                // BEGIN SANJIVA CODE
                                // is this an extension element call?
  -                             ExtensionNSHandler* nsh = 0;
  +                             ExtensionNSHandler*             nsh = 0;
   
                                if (!isEmpty(ns) && 
  -                                     ((nsh = 
m_stylesheet.lookupExtensionNSHandler (ns)) != 0)) 
  +                                     ((nsh = 
m_stylesheet.lookupExtensionNSHandler(ns)) != 0)) 
                                {
                                        elem = new ElemExtensionCall 
(m_constructionContext,
                                                                                
        m_stylesheet,
  @@ -811,6 +814,42 @@
   
   
   
  +const XalanDOMString&
  +StylesheetHandler::getNamespaceFromStack(const XalanDOMChar* theName) const
  +{
  +     const XalanDOMString* const             theNamespace =
  +             m_stylesheet.getNamespaceFromStack(theName);
  +
  +     if (theNamespace == 0)
  +     {
  +             return s_emptyString;
  +     }
  +     else
  +     {
  +             return *theNamespace;
  +     }
  +}
  +
  +
  +
  +const XalanDOMString&
  +StylesheetHandler::getNamespaceForPrefixFromStack(const XalanDOMString&      
        thePrefix) const
  +{
  +     const XalanDOMString* const             theNamespace =
  +             m_stylesheet.getNamespaceForPrefixFromStack(thePrefix);
  +
  +     if (theNamespace == 0)
  +     {
  +             return s_emptyString;
  +     }
  +     else
  +     {
  +             return *theNamespace;
  +     }
  +}
  +
  +
  +
   void
   StylesheetHandler::processTopLevelElement(
                        const XalanDOMChar*             name,
  @@ -1027,7 +1066,7 @@
                                const XalanDOMString    prefix = 
tokenizer.nextToken();
                                // SANJIVA: ask Scott: is the line below 
correct?
   
  -                             const XalanDOMString&   extns = 
m_stylesheet.getNamespaceForPrefixFromStack(prefix);
  +                             const XalanDOMString&   extns = 
getNamespaceForPrefixFromStack(prefix);
   
                                ExtensionNSHandler* const       nsh = new 
ExtensionNSHandler(extns);
   
  @@ -1134,7 +1173,7 @@
                }
   
                // SCOTT: is the line below correct?
  -             const XalanDOMString&   extns = 
m_stylesheet.getNamespaceForPrefixFromStack (prefix);
  +             const XalanDOMString&   extns = 
getNamespaceForPrefixFromStack(prefix);
   
                ExtensionNSHandler* nsh = 
m_stylesheet.lookupExtensionNSHandler(extns);
   
  
  
  
  1.29      +7 -0      xml-xalan/c/src/XSLT/StylesheetHandler.hpp
  
  Index: StylesheetHandler.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetHandler.hpp,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- StylesheetHandler.hpp     2001/05/02 15:55:58     1.28
  +++ StylesheetHandler.hpp     2001/05/14 01:03:12     1.29
  @@ -589,7 +589,12 @@
                        int                                             
lineNumber,
                        int                                             
columnNumber);
   
  +     const XalanDOMString&
  +     getNamespaceFromStack(const XalanDOMChar*       theName) const;
   
  +     const XalanDOMString&
  +     getNamespaceForPrefixFromStack(const XalanDOMString&    thePrefix) 
const;
  +
        class PushPopIncludeState
        {
        public:
  @@ -630,6 +635,8 @@
        };
   
        friend class PushPopIncludeState;
  +
  +     static const XalanDOMString                             s_emptyString;
   };
   
   
  
  
  
  1.99      +37 -25    xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp
  
  Index: XSLTEngineImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp,v
  retrieving revision 1.98
  retrieving revision 1.99
  diff -u -r1.98 -r1.99
  --- XSLTEngineImpl.cpp        2001/05/10 18:43:41     1.98
  +++ XSLTEngineImpl.cpp        2001/05/14 01:03:12     1.99
  @@ -620,7 +620,7 @@
   
   
   
  -const XalanDOMString&
  +const XalanDOMString*
   XSLTEngineImpl::getNamespaceForPrefix(const XalanDOMString&          prefix) 
const
   {
        return m_resultNamespacesStack.getNamespaceForPrefix(prefix);
  @@ -653,7 +653,7 @@
   
                if (theResolver == 0)
                {
  -                     XSLTInputSource         inputSource(c_wstr(urlString));
  +                     const XSLTInputSource   inputSource(c_wstr(urlString));
   
                        doc = parseXML(inputSource, docHandler, docToRegister);
                }
  @@ -1572,21 +1572,29 @@
                // If it's not, it means we're "turning off" the previous 
default
                // declaration.
   
  +             const XalanDOMString* const             currentDefaultNamespace 
=
  +                                     getNamespaceForPrefix(s_emptyString);
  +
                // Note that we use an empty string for the prefix, instead of 
"xmlns", since the
                // prefix really is "".
                if (length(value) != 0)
                {
  -                     addResultNamespaceDecl(s_emptyString, value);
  +                     if (currentDefaultNamespace != 0 &&
  +                             equals(*currentDefaultNamespace, value) == true)
  +                     {
  +                             fExcludeAttribute = true;
  +                     }
  +                     else
  +                     {
  +                             addResultNamespaceDecl(s_emptyString, value);
  +                     }
                }
                else
                {
                        // OK, we're turning of the previous default namespace 
declaration.
                        // Check to see if there is one, and if there isn't, 
don't add
                        // the namespace declaration _and_ don't add the 
attribute.
  -                     const XalanDOMString&   currentDefaultNamespace =
  -                                     getNamespaceForPrefix(s_emptyString);
  -
  -                     if (length(currentDefaultNamespace) != 0)
  +                     if (currentDefaultNamespace != 0 && 
length(*currentDefaultNamespace) != 0)
                        {
                                addResultNamespaceDecl(s_emptyString, value);
                        }
  @@ -2345,8 +2353,8 @@
   
        if(0 != theSize)
        {
  -             XalanDOMString          elemNS;
  -             XalanDOMString          elemLocalName;
  +             const XalanDOMString*   elemNS = 0;
  +             XalanDOMString                  elemLocalName;
   
                const unsigned int      indexOfNSSep = indexOf(elementName, 
XalanUnicode::charColon);
   
  @@ -2360,14 +2368,14 @@
   
                        if(equals(prefix, DOMServices::s_XMLString))
                        {
  -                             elemNS = DOMServices::s_XMLNamespaceURI;
  +                             elemNS = &DOMServices::s_XMLNamespaceURI;
                        }
                        else
                        {
                                elemNS = getResultNamespaceForPrefix(prefix);
                        }
   
  -                     if(0 == length(elemNS))
  +                     if(elemNS == 0)
                        {
                                error("Prefix must resolve to a namespace: " + 
prefix);
                        }
  @@ -2375,11 +2383,13 @@
                        elemLocalName = substring(elementName, indexOfNSSep + 
1);
                }
   
  +             const QNameByReference  theQName(elemNS != 0 ? *elemNS : 
s_emptyString, elemLocalName);
  +
                for(Stylesheet::QNameVectorType::size_type i = 0; i < theSize 
&& is == false; i++)
                {
                        const QName&    qname = cdataElems[i];
   
  -                     is = qname.equals(QNameByReference(elemNS, 
elemLocalName));
  +                     is = qname.equals(theQName);
                }
        }
   
  @@ -2394,8 +2404,8 @@
                        const QName&                    qname,
                        const XalanDOMString&   elementName) const
   {
  -     XalanDOMString          elemNS;
  -     XalanDOMString          elemLocalName;
  +     const XalanDOMString*   elemNS = 0;
  +     XalanDOMString                  elemLocalName;
   
        const unsigned int      indexOfNSSep = indexOf(elementName, 
XalanUnicode::charColon);
   
  @@ -2405,14 +2415,14 @@
   
                if(equals(prefix, DOMServices::s_XMLString))
                {
  -                     elemNS = DOMServices::s_XMLNamespaceURI;
  +                     elemNS = &DOMServices::s_XMLNamespaceURI;
                }
                else
                {
                        elemNS = getResultNamespaceForPrefix(prefix);
                }
   
  -             if(0 == elemNS.length())
  +             if(elemNS == 0)
                {
                        error("Prefix must resolve to a namespace: " + prefix);
                }
  @@ -2423,13 +2433,15 @@
        {
                elemLocalName = elementName;
        }
  +
  +     assert(elemNS != 0);
   
  -     return qname.equals(QNameByReference(elemNS, elemLocalName));
  +     return qname.equals(QNameByReference(*elemNS, elemLocalName));
   }
   
   
   
  -const XalanDOMString&
  +const XalanDOMString*
   XSLTEngineImpl::getResultNamespaceForPrefix(const XalanDOMString&    prefix) 
const
   {
        return m_resultNamespacesStack.getNamespaceForPrefix(prefix);
  @@ -2437,7 +2449,7 @@
     
   
   
  -const XalanDOMString&
  +const XalanDOMString*
   XSLTEngineImpl::getResultPrefixForNamespace(const XalanDOMString&    
theNamespace) const
   {
        return m_resultNamespacesStack.getPrefixForNamespace(theNamespace);
  @@ -2466,10 +2478,10 @@
                {
                        if 
(m_resultNamespacesStack.prefixIsPresentLocal(prefix) == false)
                        {
  -                             const XalanDOMString&   desturi = 
getResultNamespaceForPrefix(prefix);
  -                             const XalanDOMString&   srcURI = 
theNode.getNodeValue();
  +                             const XalanDOMString* const     desturi = 
getResultNamespaceForPrefix(prefix);
  +                             const XalanDOMString&                   srcURI 
= theNode.getNodeValue();
   
  -                             if(equals(srcURI, desturi) == false)
  +                             if(desturi == 0 || equals(srcURI, *desturi) == 
false)
                                {
                                        
addResultAttribute(thePendingAttributes, aname, srcURI);
                                }
  @@ -2477,10 +2489,10 @@
                }
                else
                {
  -                     const XalanDOMString&   desturi = 
getResultNamespaceForPrefix(prefix);
  -                     const XalanDOMString&   srcURI = theNode.getNodeValue();
  +                     const XalanDOMString* const     desturi = 
getResultNamespaceForPrefix(prefix);
  +                     const XalanDOMString&                   srcURI = 
theNode.getNodeValue();
   
  -                     if(equals(srcURI, desturi) == false)
  +                     if(desturi == 0 || equals(srcURI, *desturi) == false)
                        {
                                addResultAttribute(thePendingAttributes, aname, 
srcURI);
                        }
  
  
  
  1.67      +3 -3      xml-xalan/c/src/XSLT/XSLTEngineImpl.hpp
  
  Index: XSLTEngineImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.hpp,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- XSLTEngineImpl.hpp        2001/05/10 18:04:22     1.66
  +++ XSLTEngineImpl.hpp        2001/05/14 01:03:12     1.67
  @@ -340,7 +340,7 @@
         * @param prefix Prefix to resolve
         * @return namespace that prefix resolves to, or null if prefix is not 
found
         */
  -     virtual const XalanDOMString&
  +     virtual const XalanDOMString*
        getNamespaceForPrefix(const XalanDOMString&             prefix) const;
   
        /**
  @@ -914,7 +914,7 @@
         * @param prefix prefix for namespace
         * @return string for namespace URI
         */
  -     const XalanDOMString&
  +     const XalanDOMString*
        getResultNamespaceForPrefix(const XalanDOMString&       prefix) const;
     
        /**
  @@ -923,7 +923,7 @@
         * @param theNamespace namespace for prefix
         * @return string for namespace prefix
         */
  -     const XalanDOMString&
  +     const XalanDOMString*
        getResultPrefixForNamespace(const XalanDOMString&       theNamespace) 
const;
   
        /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to