dbertoni    00/05/29 15:33:48

  Modified:    c/src/XSLT ElemTemplateElement.cpp ElemTemplateElement.hpp
  Log:
  Added a string for the base identifier to fix the document() function.  
Created some objects to automatically handle the stack frame index.
  
  Revision  Changes    Path
  1.22      +23 -14    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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- ElemTemplateElement.cpp   2000/05/26 19:25:36     1.21
  +++ ElemTemplateElement.cpp   2000/05/29 22:33:47     1.22
  @@ -131,8 +131,11 @@
        m_nextSibling(0),
        m_previousSibling(0),
        m_firstChild(0),
  -     m_surrogateChildren(*this)
  +     m_surrogateChildren(*this),
  +     m_baseIndentifier(stylesheetTree.getCurrentIncludeBaseIdentifier())
   {
  +     assert(length(m_baseIndentifier) > 0);
  +
        /*
         * Copy the stylesheet namespaces to the element namespace vector
         */
  @@ -304,6 +307,8 @@
                        XalanNode*                                              
sourceNode,
                        const QName&                                    mode) 
const
   {
  +     StylesheetExecutionContext::PushAndPopElementFrame      
thePushAndPop(executionContext, this);
  +
       for (ElemTemplateElement* node = m_firstChild; node != 0; node = 
node->m_nextSibling) 
       {
         node->execute(executionContext, sourceTree, sourceNode, mode);
  @@ -570,6 +575,8 @@
                        int                                                     
        xslToken,
                        int selectStackFrameIndex) const
   {
  +     typedef StylesheetExecutionContext::SetAndRestoreCurrentStackFrameIndex 
        SetAndRestoreCurrentStackFrameIndex;
  +
        // Sort the nodes according to the xsl:sort method
        const int       tok = xslInstruction.getXSLToken();
   
  @@ -627,10 +634,12 @@
       NodeCallback callback = (null == keys) ? this : null;
   */
   
  -     int savedCurrentStackFrameIndex = 
executionContext.getCurrentStackFrameIndex();
        if (0 != selectPattern)
        {
  -             
executionContext.setCurrentStackFrameIndex(selectStackFrameIndex);
  +             SetAndRestoreCurrentStackFrameIndex             
theSetAndRestore(
  +                             executionContext,
  +                             selectStackFrameIndex);
  +
   /*
        @@@ JMD: This is newer java code that is not implemented in C++; the
        callback mechanism may affect the correct positioning of the stack 
frame and
  @@ -666,8 +675,6 @@
                                                        result));
                        }
                }
  -
  -             
executionContext.setCurrentStackFrameIndex(savedCurrentStackFrameIndex);
        }
        else if (keys.size() > 0)
        {
  @@ -681,17 +688,14 @@
                if (keys.size() > 0)
                {
                        NodeSorter sorter(executionContext);
  +
  +                     SetAndRestoreCurrentStackFrameIndex             
theSetAndRestore(
  +                             executionContext,
  +                             selectStackFrameIndex);
   
  -                     
executionContext.setCurrentStackFrameIndex(selectStackFrameIndex);
                        sorter.sort(sourceNodes, keys);
  -                     
executionContext.setCurrentStackFrameIndex(savedCurrentStackFrameIndex);
                }
   
  -             // Create an object to set and restore the context node list...
  -             StylesheetExecutionContext::ContextNodeListSetAndRestore        
theSetAndRestore(
  -                             executionContext,
  -                             sourceNodes);
  -
                if(executionContext.getTraceSelects() == true)
                {
                        executionContext.traceSelect(
  @@ -699,6 +703,11 @@
                                sourceNodes);
                }
   
  +             // Create an object to set and restore the context node list...
  +             StylesheetExecutionContext::ContextNodeListSetAndRestore        
theSetAndRestore(
  +                             executionContext,
  +                             sourceNodes);
  +
                for(unsigned int i = 0; i < nNodes; i++) 
                {
                        XalanNode*                              childNode = 
sourceNodes.item(i);
  @@ -742,7 +751,7 @@
        bool                            doApplyTemplate = true;
        bool                            shouldStrip = false;
   
  -     const const XalanNode::NodeType         nodeType = child->getNodeType();
  +     const XalanNode::NodeType       nodeType = child->getNodeType();
   
        const Stylesheet*       stylesheetTree = &stylesheet_tree;
   
  @@ -1397,7 +1406,7 @@
   XalanDOMString
   ElemTemplateElement::getURI() const
   {
  -     return getStylesheet().getBaseIdentifier();
  +     return m_baseIndentifier;
   }
   
   
  
  
  
  1.11      +2 -0      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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ElemTemplateElement.hpp   2000/05/24 19:38:48     1.10
  +++ ElemTemplateElement.hpp   2000/05/29 22:33:47     1.11
  @@ -767,6 +767,8 @@
        ElemTemplateElement*    m_firstChild;
   
        XalanNodeListSurrogate  m_surrogateChildren;
  +
  +     const XalanDOMString    m_baseIndentifier;
   };
   
   
  
  
  

Reply via email to