zongaro     2002/11/26 07:02:42

  Modified:    java/src/org/apache/xml/dtm/ref/sax2dtm Tag: XSLTC_DTM
                        SAX2DTM.java
  Log:
  1) In addNode, changed code that determines whether the current node is the
     first child of its parent.  Code used to check whether the first child of
     the parent was previously set; changed this to check whether the new node
     has a previous sibling.  This is an improvement for nodes that have many
     children.  Made a similar change to endElement.
  
  2) Changed initial size of m_data from 32 to m_initialblocksize.  I believe
     the old value was only needed before RTF's shared a DTM.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.28.2.7  +8 -6      xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
  
  Index: SAX2DTM.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java,v
  retrieving revision 1.28.2.6
  retrieving revision 1.28.2.7
  diff -u -r1.28.2.6 -r1.28.2.7
  --- SAX2DTM.java      16 Nov 2002 11:39:41 -0000      1.28.2.6
  +++ SAX2DTM.java      26 Nov 2002 15:02:42 -0000      1.28.2.7
  @@ -265,7 +265,7 @@
       // %REVIEW%  Initial size pushed way down to reduce weight of RTFs
       // (I'm not entirely sure 0 would work, so I'm playing it safe for now.)
       //m_data = new SuballocatedIntVector(doIndexing ? (1024*2) : 512, 1024);
  -    m_data = new SuballocatedIntVector(32, 1024);
  +    m_data = new SuballocatedIntVector(m_initialblocksize);
   
       m_data.addElement(0);   // Need placeholder in case index into here must be <0.
   
  @@ -917,9 +917,9 @@
       case DTM.ATTRIBUTE_NODE:
         break;
       default:
  -      if (DTM.NULL != parentIndex &&
  -       NOTPROCESSED == m_firstch.elementAt(parentIndex))
  +      if (DTM.NULL == previousSibling && DTM.NULL != parentIndex) {
           m_firstch.setElementAt(nodeIndex,parentIndex);
  +      }
         break;
       }
   
  @@ -1812,10 +1812,10 @@
       String prefix = getPrefix(qName, uri);
       int prefixIndex = (null != prefix)
                         ? m_valuesOrPrefixes.stringToIndex(qName) : 0;
  +
       int elemNode = addNode(DTM.ELEMENT_NODE, exName,
                              m_parents.peek(), m_previous, prefixIndex, true);
   
  -
       if(m_indexing)
         indexNode(exName, elemNode);
       
  @@ -1974,9 +1974,10 @@
   
       m_previous = m_parents.pop();
   
  -    if (NOTPROCESSED == m_firstch.elementAt(m_previous))
  +    // If lastNode is still DTM.NULL, this element had no children
  +    if (DTM.NULL == lastNode)
         m_firstch.setElementAt(DTM.NULL,m_previous);
  -    else if (DTM.NULL != lastNode)
  +    else
         m_nextsib.setElementAt(DTM.NULL,lastNode);
   
       popShouldStripWhitespace();
  @@ -2388,6 +2389,7 @@
       // seperate FSB buffer instead.
       int dataIndex = m_valuesOrPrefixes.stringToIndex(new String(ch, start,
                         length));
  +
   
       m_previous = addNode(DTM.COMMENT_NODE, exName,
                            m_parents.peek(), m_previous, dataIndex, false);
  
  
  

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

Reply via email to