dbertoni    01/02/13 08:49:13

  Modified:    c/src/XSLT ElemElement.cpp XSLTEngineImpl.cpp
  Log:
  Make sure the default namespace is re-declared when necessary.  Fixes 
namespace36.
  
  Revision  Changes    Path
  1.21      +12 -0     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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- ElemElement.cpp   2001/02/12 23:55:23     1.20
  +++ ElemElement.cpp   2001/02/13 16:49:12     1.21
  @@ -212,6 +212,18 @@
                        executionContext.startElement(c_wstr(elemName));   
   
                        
m_namespacesHandler.outputResultNamespaces(executionContext);
  +
  +                     // OK, now let's check to make sure we don't have to 
change the default namespace...
  +                     const XalanDOMString&   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
                {
  
  
  
  1.88      +4 -1      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.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- XSLTEngineImpl.cpp        2001/02/11 05:18:13     1.87
  +++ XSLTEngineImpl.cpp        2001/02/13 16:49:12     1.88
  @@ -1501,6 +1501,9 @@
                // of the namespace is 0.  If it's not, go ahead and add the 
declaration.
                // If it's not, it means we're "turning off" the previous 
default
                // declaration.
  +
  +             // 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);
  @@ -1511,7 +1514,7 @@
                        // 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(DOMServices::s_XMLNamespace);
  +                                     getNamespaceForPrefix(s_emptyString);
   
                        if (length(currentDefaultNamespace) != 0)
                        {
  
  
  

Reply via email to