dbertoni    01/02/09 15:24:14

  Modified:    c/src/XSLT ElemAttribute.cpp
  Log:
  Fixed bug where namespace declaration was not being added.
  
  Revision  Changes    Path
  1.17      +22 -0     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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ElemAttribute.cpp 2001/02/08 21:46:44     1.16
  +++ ElemAttribute.cpp 2001/02/09 23:24:11     1.17
  @@ -289,6 +289,28 @@
                                        // Could not resolve prefix
                                        executionContext.warn("Warning: Could 
not resolve prefix " + nsprefix, sourceNode, this);
                                }
  +                             else
  +                             {
  +                                     // Check to see if there's already a 
namespace declaration in scope...
  +                                     const XalanDOMString&   prefix = 
executionContext.getResultPrefixForNamespace(attrNameSpace);
  +
  +                                     if (length(prefix) == 0)
  +                                     {
  +                                             // We need to generate a 
namespace declaration...
  +                                             
StylesheetExecutionContext::GetAndReleaseCachedString   
nsDeclGuard(executionContext);
  +
  +                                             XalanDOMString&         nsDecl 
= nsDeclGuard.get();
  +
  +                                             reserve(nsDecl, 
DOMServices::s_XMLNamespaceWithSeparatorLength + length(nsprefix) + 1);
  +
  +                                             assign(nsDecl, 
DOMServices::s_XMLNamespaceWithSeparator);
  +
  +                                             append(nsDecl, nsprefix);
  +
  +                                             // Add the namespace 
declaration...
  +                                             
executionContext.addResultAttribute(nsDecl, attrNameSpace);
  +                                     }
  +                             }
                        }
                }
                else
  
  
  

Reply via email to