You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2001/11/01 16:51:15 UTC

cvs commit: xml-xalan/c/src/XalanSourceTree FormatterToSourceTree.cpp FormatterToSourceTree.hpp XalanSourceTreeComment.cpp XalanSourceTreeComment.hpp XalanSourceTreeCommentAllocator.cpp XalanSourceTreeCommentAllocator.hpp XalanSourceTreeDocument.cpp XalanSourceTreeDocument.hpp XalanSourceTreeDocumentFragment.cpp XalanSourceTreeDocumentFragment.hpp XalanSourceTreeElement.cpp XalanSourceTreeElement.hpp XalanSourceTreeElementAllocator.cpp XalanSourceTreeElementAllocator.hpp XalanSourceTreeElementNS.cpp XalanSourceTreeElementNS.hpp XalanSourceTreeElementNSAllocator.cpp XalanSourceTreeElementNSAllocator.hpp XalanSourceTreeHelper.cpp XalanSourceTreeHelper.hpp XalanSourceTreeProcessingInstruction.cpp XalanSourceTreeProcessingInstruction.hpp XalanSourceTreeProcessingInstructionAllocator.cpp XalanSourceTreeProcessingInstructionAllocator.hpp XalanSourceTreeText.cpp XalanSourceTreeText.hpp XalanSourceTreeTextAllocator.cpp XalanSourceTreeTextAllocator.hpp XalanSourceTreeTextIWS.cpp XalanSourceTreeTextIWS.hpp XalanSourceTreeTextIWSAllocator.cpp XalanSourceTreeTextIWSAllocator.hpp

dbertoni    01/11/01 07:51:15

  Modified:    c/src/XalanSourceTree FormatterToSourceTree.cpp
                        FormatterToSourceTree.hpp
                        XalanSourceTreeComment.cpp
                        XalanSourceTreeComment.hpp
                        XalanSourceTreeCommentAllocator.cpp
                        XalanSourceTreeCommentAllocator.hpp
                        XalanSourceTreeDocument.cpp
                        XalanSourceTreeDocument.hpp
                        XalanSourceTreeDocumentFragment.cpp
                        XalanSourceTreeDocumentFragment.hpp
                        XalanSourceTreeElement.cpp
                        XalanSourceTreeElement.hpp
                        XalanSourceTreeElementAllocator.cpp
                        XalanSourceTreeElementAllocator.hpp
                        XalanSourceTreeElementNS.cpp
                        XalanSourceTreeElementNS.hpp
                        XalanSourceTreeElementNSAllocator.cpp
                        XalanSourceTreeElementNSAllocator.hpp
                        XalanSourceTreeHelper.cpp XalanSourceTreeHelper.hpp
                        XalanSourceTreeProcessingInstruction.cpp
                        XalanSourceTreeProcessingInstruction.hpp
                        XalanSourceTreeProcessingInstructionAllocator.cpp
                        XalanSourceTreeProcessingInstructionAllocator.hpp
                        XalanSourceTreeText.cpp XalanSourceTreeText.hpp
                        XalanSourceTreeTextAllocator.cpp
                        XalanSourceTreeTextAllocator.hpp
                        XalanSourceTreeTextIWS.cpp
                        XalanSourceTreeTextIWS.hpp
                        XalanSourceTreeTextIWSAllocator.cpp
                        XalanSourceTreeTextIWSAllocator.hpp
  Log:
  Fixes for XalanSourceTreeDocumentFragment implementation.
  
  Revision  Changes    Path
  1.9       +134 -58   xml-xalan/c/src/XalanSourceTree/FormatterToSourceTree.cpp
  
  Index: FormatterToSourceTree.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/FormatterToSourceTree.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FormatterToSourceTree.cpp	2001/10/30 03:59:43	1.8
  +++ FormatterToSourceTree.cpp	2001/11/01 15:51:14	1.9
  @@ -85,6 +85,7 @@
   #include "XalanSourceTreeDocument.hpp"
   #include "XalanSourceTreeDocumentFragment.hpp"
   #include "XalanSourceTreeElement.hpp"
  +#include "XalanSourceTreeHelper.hpp"
   #include "XalanSourceTreeProcessingInstruction.hpp"
   #include "XalanSourceTreeText.hpp"
   
  @@ -96,6 +97,8 @@
   	m_documentFragment(0),
   	m_currentElement(0),
   	m_elementStack(),
  +	m_lastChild(0),
  +	m_lastChildStack(),
   	m_textBuffer()
   {
   }
  @@ -110,6 +113,8 @@
   	m_documentFragment(theDocumentFragment),
   	m_currentElement(0),
   	m_elementStack(),
  +	m_lastChild(0),
  +	m_lastChildStack(),
   	m_textBuffer()
   {
   	assert(m_document != 0);
  @@ -134,6 +139,23 @@
   void
   FormatterToSourceTree::startDocument()
   {
  +	m_currentElement = 0;
  +
  +	m_elementStack.clear();
  +
  +	m_lastChild = 0;
  +
  +	m_lastChildStack.clear();
  +
  +	m_lastChildStack.reserve(eDefaultStackSize);
  +
  +	clear(m_textBuffer);
  +
  +	reserve(m_textBuffer, eDefaultTextBufferSize);
  +
  +	// Push a dummy value for the current element, so we
  +	// don't have to check for an empty stack in endElement().
  +	m_elementStack.push_back(ElementStackType::value_type(0));
   }
   
   
  @@ -141,37 +163,101 @@
   void
   FormatterToSourceTree::endDocument()
   {
  -	assert(m_elementStack.empty() == true);
  +	// Pop off the dummy value that we pushed in 
  +	// startDocument()...
  +	m_elementStack.pop_back();
   
  +	assert(m_elementStack.empty() == true);
  +	assert(m_lastChildStack.empty() == true);
   	assert(isEmpty(m_textBuffer) == true);
   }
   
   
   
  -void
  -FormatterToSourceTree::startElement(
  -			const	XMLCh* const	name,
  -			AttributeList&			attrs)
  +// A helper function to manage appending the new child.
  +template <class ParentNodeType, class ChildNodeType>
  +inline void
  +doAppendChildNode(
  +			ParentNodeType*		theParent,
  +			XalanNode*&			theLastChild,
  +			ChildNodeType		theNewChild)
   {
  -	XalanSourceTreeElement* const	theNewElement =
  -		createElementNode(name, attrs, m_currentElement);
  +	assert(theParent != 0);
  +	assert(theNewChild != 0);
   
  -	if (m_currentElement != 0)
  +	if (theLastChild == 0)
   	{
  -		m_currentElement->appendChildNode(theNewElement);
  +		theParent->appendChildNode(theNewChild);
   	}
  -	else if(m_documentFragment != 0)
  +	else
  +	{
  +		XalanSourceTreeHelper::appendSibling(theLastChild, theNewChild);
  +	}
  +
  +	theLastChild = theNewChild;
  +}
  +
  +
  +
  +// A helper function to manage appending the new child.
  +template <class ChildNodeType>
  +inline void
  +doAppendChildNode(
  +			XalanSourceTreeDocument*			theDocument,
  +			XalanSourceTreeDocumentFragment*	theDocumentFragment,
  +			XalanSourceTreeElement*				theCurrentElement,
  +			XalanNode*&							theLastChild,
  +			ChildNodeType						theNewChild)
  +{
  +	assert(theDocument != 0);
  +	assert(theNewChild != 0);
  +
  +	if (theCurrentElement == 0)
   	{
  -		m_documentFragment->appendChildNode(theNewElement);
  +		if (theDocumentFragment != 0)
  +		{
  +			doAppendChildNode(theDocumentFragment, theLastChild, theNewChild);
  +		}
  +		else
  +		{
  +			// If there is no current element. it means we haven't
  +			// created the document element yet, so always append
  +			// to the document, rather than the last child.
  +			theDocument->appendChildNode(theNewChild);
  +		}
   	}
   	else
   	{
  -		m_document->appendChildNode(theNewElement);
  +		doAppendChildNode(theCurrentElement, theLastChild, theNewChild);
   	}
  +}
  +
  +
  +
  +void
  +FormatterToSourceTree::startElement(
  +			const	XMLCh* const	name,
  +			AttributeList&			attrs)
  +{
  +	processAccumulatedText();
  +
  +	XalanSourceTreeElement* const	theNewElement =
  +		createElementNode(name, attrs, m_currentElement);
  +
  +	doAppendChildNode(
  +			m_document,
  +			m_documentFragment,
  +			m_currentElement,
  +			m_lastChild,
  +			theNewElement);
   
   	m_elementStack.push_back(theNewElement);
   
  +	m_lastChildStack.push_back(m_lastChild);
  +
   	m_currentElement = theNewElement;
  +
  +	m_lastChild = 0;
   }
   
   
  @@ -186,16 +272,18 @@
   	// Pop the element of the stack...
   	m_elementStack.pop_back();
   
  +	assert(m_elementStack.empty() == false);
  +
   	// Get the element from the back of the
  -	// stack, if any...
  -	if (m_elementStack.empty() == false)
  -	{
  -		m_currentElement = m_elementStack.back();
  -	}
  -	else
  -	{
  -		m_currentElement = 0;
  -	}
  +	// stack.
  +	m_currentElement = m_elementStack.back();
  +
  +	assert(m_lastChildStack.empty() == false);
  +
  +	m_lastChild = m_lastChildStack.back();
  +
  +	// Pop the last child stack
  +	m_lastChildStack.pop_back();
   }
   
   
  @@ -264,10 +352,7 @@
   		XalanSourceTreeText* const	theNewTextNode =
   			m_document->createTextIWSNode(chars, length, m_currentElement);
   
  -		if (m_currentElement != 0)
  -		{
  -			m_currentElement->appendChildNode(theNewTextNode);
  -		}
  +		doAppendChildNode(m_currentElement, m_lastChild, theNewTextNode);
   	}
   	else if(m_documentFragment != 0)
   	{
  @@ -276,7 +361,7 @@
   		XalanSourceTreeText* const	theNewTextNode =
   			m_document->createTextIWSNode(chars, length, m_currentElement);
   
  -		m_documentFragment->appendChildNode(theNewTextNode);
  +		doAppendChildNode(m_currentElement, m_lastChild, theNewTextNode);
   	}
   }
   
  @@ -313,18 +398,12 @@
   	XalanSourceTreeComment* const	theNewComment =
   		m_document->createCommentNode(data, length(data), m_currentElement);
   
  -	if (m_currentElement != 0)
  -	{
  -		m_currentElement->appendChildNode(theNewComment);
  -	}
  -	else if(m_documentFragment != 0)
  -	{
  -		m_documentFragment->appendChildNode(theNewComment);
  -	}
  -	else
  -	{
  -		m_document->appendChildNode(theNewComment);
  -	}
  +	doAppendChildNode(
  +			m_document,
  +			m_documentFragment,
  +			m_currentElement,
  +			m_lastChild,
  +			theNewComment);
   }
   
   
  @@ -357,12 +436,18 @@
   			XalanDOMString::size_type	length)
   {
   	if (m_currentElement != 0)
  -	{
  -		m_currentElement->appendChildNode(m_document->createTextNode(chars, length, m_currentElement));
  -	}
  -	else if(m_documentFragment != 0)
   	{
  -		m_documentFragment->appendChildNode(m_document->createTextNode(chars, length, m_currentElement));
  +		doAppendChildNode(
  +			m_currentElement,
  +			m_lastChild,
  +			m_document->createTextNode(chars, length, m_currentElement));
  +	}
  +	else if (m_documentFragment != 0)
  +	{
  +		doAppendChildNode(
  +			m_documentFragment,
  +			m_lastChild,
  +			m_document->createTextNode(chars, length, m_currentElement));
   	}
   	else
   	{
  @@ -395,19 +480,10 @@
   			const XMLCh*	target,
   			const XMLCh*	data)
   {
  -	XalanSourceTreeProcessingInstruction* const		theNewPI =
  -		m_document->createProcessingInstructionNode(target, data);
  -
  -	if (m_currentElement != 0)
  -	{
  -		m_currentElement->appendChildNode(m_document->createProcessingInstructionNode(target, data, m_currentElement));
  -	}
  -	else if(m_documentFragment != 0)
  -	{
  -		m_documentFragment->appendChildNode(theNewPI);
  -	}
  -	else
  -	{
  -		m_document->appendChildNode(theNewPI);
  -	}
  +	doAppendChildNode(
  +			m_document,
  +			m_documentFragment,
  +			m_currentElement,
  +			m_lastChild,
  +			m_document->createProcessingInstructionNode(target, data));
   }
  
  
  
  1.10      +25 -10    xml-xalan/c/src/XalanSourceTree/FormatterToSourceTree.hpp
  
  Index: FormatterToSourceTree.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/FormatterToSourceTree.hpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- FormatterToSourceTree.hpp	2001/10/30 03:59:43	1.9
  +++ FormatterToSourceTree.hpp	2001/11/01 15:51:14	1.10
  @@ -78,6 +78,7 @@
   
   
   class PrefixResolver;
  +class XalanNode;
   class XalanSourceTreeDocument;
   class XalanSourceTreeDocumentFragment;
   class XalanSourceTreeElement;
  @@ -92,6 +93,16 @@
   {
   public:
   
  +#if defined(XALAN_NO_NAMESPACES)
  +	typedef vector<XalanSourceTreeElement*>			ElementStackType;
  +	typedef vector<XalanNode*> 						LastChildStackType;
  +#else
  +	typedef std::vector<XalanSourceTreeElement*>	ElementStackType;
  +	typedef std::vector<XalanNode*> 				LastChildStackType;
  +#endif
  +
  +	enum { eDefaultStackSize = 50, eDefaultTextBufferSize = 100 };
  +
   	/**
   	 * Perform static initialization.  See class XalanSourceTreeInit.
   	 */
  @@ -242,21 +253,25 @@
   
   
   	// Data members...
  -	XalanSourceTreeDocument*						m_document;
  +	XalanSourceTreeDocument*			m_document;
   
  -	XalanSourceTreeDocumentFragment*				m_documentFragment;
  +	XalanSourceTreeDocumentFragment*	m_documentFragment;
   
  -	XalanSourceTreeElement*							m_currentElement;
  +	XalanSourceTreeElement*				m_currentElement;
   
  -#if defined(XALAN_NO_NAMESPACES)
  -	typedef vector<XalanSourceTreeElement*>			ElementStackType;
  -#else
  -	typedef std::vector<XalanSourceTreeElement*>	ElementStackType;
  -#endif
  +	ElementStackType					m_elementStack;
  +
  +	// The last child appended to the current element.  This is
  +	// an important optimization, because XalanSourceTreeElement
  +	// does not have a pointer to it's last child.  Without this,
  +	// appending a child becomes a linear search.
  +	XalanNode* 							m_lastChild;
   
  -	ElementStackType								m_elementStack;
  +	// Stack of last children appended.  There is a ono-to-one
  +	// correspondance to the entries in m_elementStack.
  +	LastChildStackType					m_lastChildStack;
   
  -	XalanDOMString									m_textBuffer;
  +	XalanDOMString						m_textBuffer;
   };
   
   
  
  
  
  1.7       +22 -5     xml-xalan/c/src/XalanSourceTree/XalanSourceTreeComment.cpp
  
  Index: XalanSourceTreeComment.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeComment.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XalanSourceTreeComment.cpp	2001/10/02 21:34:19	1.6
  +++ XalanSourceTreeComment.cpp	2001/11/01 15:51:14	1.7
  @@ -67,6 +67,7 @@
   
   
   #include "XalanSourceTreeDocument.hpp"
  +#include "XalanSourceTreeDocumentFragment.hpp"
   #include "XalanSourceTreeElement.hpp"
   #include "XalanSourceTreeProcessingInstruction.hpp"
   #include "XalanSourceTreeText.hpp"
  @@ -81,14 +82,14 @@
   XalanSourceTreeComment::XalanSourceTreeComment(
   			const XalanDOMString&		theData,
   			XalanSourceTreeDocument*	theOwnerDocument,
  -			XalanSourceTreeElement*		theParentElement,
  +			XalanNode*					theParentNode,
   			XalanNode*					thePreviousSibling,
   			XalanNode*					theNextSibling,
   			unsigned int				theIndex) :
   	XalanComment(),
   	m_data(theData),
   	m_ownerDocument(theOwnerDocument),
  -	m_parentElement(theParentElement),
  +	m_parentNode(theParentNode),
   	m_previousSibling(thePreviousSibling),
   	m_nextSibling(theNextSibling),
   	m_index(theIndex)
  @@ -108,7 +109,7 @@
   			bool							/* deep */) :
   	XalanComment(theSource),
   	m_data(theSource.m_data),
  -	m_parentElement(0),
  +	m_parentNode(0),
   	m_previousSibling(0),
   	m_nextSibling(0),
   	m_index(0)
  @@ -146,9 +147,9 @@
   {
   	assert(m_ownerDocument != 0);
   
  -	if (m_parentElement != 0)
  +	if (m_parentNode != 0)
   	{
  -		return m_parentElement;
  +		return m_parentNode;
   	}
   	else
   	{
  @@ -424,6 +425,22 @@
   			const XalanDOMString&	/* arg */)
   {
   	throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  +}
  +
  +
  +
  +void
  +XalanSourceTreeComment::setParent(XalanSourceTreeElement*	theParent)
  +{
  +	m_parentNode = theParent;
  +}
  +
  +
  +
  +void
  +XalanSourceTreeComment::setParent(XalanSourceTreeDocumentFragment*	theParent)
  +{
  +	m_parentNode = theParent;
   }
   
   
  
  
  
  1.4       +7 -12     xml-xalan/c/src/XalanSourceTree/XalanSourceTreeComment.hpp
  
  Index: XalanSourceTreeComment.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeComment.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XalanSourceTreeComment.hpp	2001/10/02 21:34:19	1.3
  +++ XalanSourceTreeComment.hpp	2001/11/01 15:51:14	1.4
  @@ -72,6 +72,7 @@
   
   
   class XalanSourceTreeDocument;
  +class XalanSourceTreeDocumentFragment;
   class XalanSourceTreeElement;
   class XalanSourceTreeProcessingInstruction;
   class XalanSourceTreeText;
  @@ -108,7 +109,7 @@
   	 *
   	 * @param theData The text data of the node.
   	 * @param theOwnerDocument The owner document of the comment node.
  -	 * @param theParentElement The parent element, if any.
  +	 * @param theParentNode The parent node, if any.
   	 * @param thePreviousSibling The previous sibling, if any.
   	 * @param theNextSibling The next sibling, if any.
   	 * @param theIndex The document-order index of the node.
  @@ -116,7 +117,7 @@
   	XalanSourceTreeComment(
   			const XalanDOMString&		theData,
   			XalanSourceTreeDocument*	theOwnerDocument,
  -			XalanSourceTreeElement*		theParentElement = 0,
  +			XalanNode*					theParentNode = 0,
   			XalanNode*					thePreviousSibling = 0,
   			XalanNode*					theNextSibling = 0,
   			unsigned int				theIndex = 0);
  @@ -600,17 +601,11 @@
   
   	// public interfaces not inherited from XalanComment...
   
  -	XalanSourceTreeElement*
  -	getParentElement() const
  -	{
  -		return m_parentElement;
  -	}
  +	void
  +	setParent(XalanSourceTreeElement*	theParent);
   
   	void
  -	setParentElement(XalanSourceTreeElement*	theParentElement)
  -	{
  -		m_parentElement = theParentElement;
  -	}
  +	setParent(XalanSourceTreeDocumentFragment*	theParent);
   
   	void
   	setPreviousSibling(XalanSourceTreeComment*	thePreviousSibling);
  @@ -663,7 +658,7 @@
   
   	XalanSourceTreeDocument*		m_ownerDocument;
   
  -	XalanSourceTreeElement*			m_parentElement;
  +	XalanNode*						m_parentNode;
   
   	XalanNode*						m_previousSibling;
   
  
  
  
  1.3       +2 -2      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeCommentAllocator.cpp
  
  Index: XalanSourceTreeCommentAllocator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeCommentAllocator.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XalanSourceTreeCommentAllocator.cpp	2000/12/17 22:26:58	1.2
  +++ XalanSourceTreeCommentAllocator.cpp	2001/11/01 15:51:14	1.3
  @@ -77,7 +77,7 @@
   XalanSourceTreeCommentAllocator::create(
   			const XalanDOMString&		theData,
   			XalanSourceTreeDocument*	theOwnerDocument,
  -			XalanSourceTreeElement*		theParentElement,
  +			XalanNode*					theParentNode,
   			XalanNode*					thePreviousSibling,
   			XalanNode*					theNextSibling,
   			unsigned int				theIndex)
  @@ -88,7 +88,7 @@
   	new(theBlock) ObjectType(
   						theData,
   						theOwnerDocument,
  -						theParentElement,
  +						theParentNode,
   						thePreviousSibling,
   						theNextSibling,
   						theIndex);
  
  
  
  1.3       +2 -2      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeCommentAllocator.hpp
  
  Index: XalanSourceTreeCommentAllocator.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeCommentAllocator.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XalanSourceTreeCommentAllocator.hpp	2000/12/17 22:26:58	1.2
  +++ XalanSourceTreeCommentAllocator.hpp	2001/11/01 15:51:14	1.3
  @@ -103,7 +103,7 @@
   	 * 
   	 * @param theData The data for the comment
   	 * @param theOwnerDocument The owner document of the comment node.
  -	 * @param theParentElement The parent element, if any.
  +	 * @param theParentNode The parent node, if any.
   	 * @param thePreviousSibling The next sibling, if any.
   	 * @param theNextSibling The next sibling, if any.
   	 * @param theIndex The document-order index of the node.
  @@ -114,7 +114,7 @@
   	create(
   			const XalanDOMString&		theData,
   			XalanSourceTreeDocument*	theOwnerDocument,
  -			XalanSourceTreeElement*		theParentElement = 0,
  +			XalanNode*					theParentNode = 0,
   			XalanNode*					thePreviousSibling = 0,
   			XalanNode*					theNextSibling = 0,
   			unsigned int				theIndex = 0);
  
  
  
  1.23      +33 -32    xml-xalan/c/src/XalanSourceTree/XalanSourceTreeDocument.cpp
  
  Index: XalanSourceTreeDocument.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeDocument.cpp,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- XalanSourceTreeDocument.cpp	2001/10/03 18:17:34	1.22
  +++ XalanSourceTreeDocument.cpp	2001/11/01 15:51:14	1.23
  @@ -558,7 +558,7 @@
   XalanSourceTreeDocument::createElementNode(
   			const XalanDOMChar*			name,
   			const AttributeList&		attrs,
  -			XalanSourceTreeElement*		theParentElement,
  +			XalanNode*					theParentNode,
   			XalanNode*					thePreviousSibling,
   			XalanNode*					theNextSibling,
   			bool						fAddXMLNamespaceAttribute)
  @@ -583,10 +583,11 @@
   				this,
   				theAttributeVector,
   				theAttributeCount,
  -				theParentElement,
  +				theParentNode,
   				thePreviousSibling,
   				theNextSibling,
   				m_nextIndexValue++);
  +	assert(theNewElement != 0);
   
   	size_t	theIndex = 0;
   
  @@ -650,7 +651,7 @@
   			const XalanDOMChar*			tagName,
   			const AttributeList&		attrs,
   			const PrefixResolver&		thePrefixResolver,
  -			XalanSourceTreeElement*		theParentElement,
  +			XalanNode*					theParentNode,
   			XalanNode*					thePreviousSibling,
   			XalanNode*					theNextSibling,
   			bool						fAddXMLNamespaceAttribute)
  @@ -670,11 +671,11 @@
   		theAttributeCount == 0 ? 0 : m_attributesVector.allocate(theAttributeCount);
   
   	XalanSourceTreeElement* const	theNewElement =
  -		createElement(
  +		createElementNode(
   			tagName,
   			theAttributeVector,
   			theAttributeCount,
  -			theParentElement,
  +			theParentNode,
   			thePreviousSibling,
   			theNextSibling,
   			thePrefixResolver);
  @@ -765,7 +766,7 @@
   			const XalanDOMChar*			localname,
   			const XalanDOMChar*			qname,
   			const Attributes&			attrs,
  -			XalanSourceTreeElement*		theParentElement,
  +			XalanNode*					theParentNode,
   			XalanNode*					thePreviousSibling,
   			XalanNode*					theNextSibling,
   			bool						fAddXMLNamespaceAttribute)
  @@ -798,7 +799,7 @@
   				this,
   				theAttributeVector,
   				theAttributeCount,
  -				theParentElement,
  +				theParentNode,
   				thePreviousSibling,
   				theNextSibling,
   				m_nextIndexValue++);
  @@ -817,7 +818,7 @@
   XalanSourceTreeDocument::createElementNode(
   			const XalanDOMChar*			name,
   			const Attributes&			attrs,
  -			XalanSourceTreeElement*		theParentElement,
  +			XalanNode*					theParentNode,
   			XalanNode*					thePreviousSibling,
   			XalanNode*					theNextSibling,
   			bool						fAddXMLNamespaceAttribute)
  @@ -844,7 +845,7 @@
   				this,
   				theAttributeVector,
   				theAttributeCount,
  -				theParentElement,
  +				theParentNode,
   				thePreviousSibling,
   				theNextSibling,
   				m_nextIndexValue++);
  @@ -863,14 +864,14 @@
   XalanSourceTreeDocument::createCommentNode(
   			const XalanDOMChar*			data,
   			XalanDOMString::size_type	length,
  -			XalanSourceTreeElement*		theParentElement,
  +			XalanNode*					theParentNode,
   			XalanNode*					thePreviousSibling,
   			XalanNode*					theNextSibling)
   {
   	return m_commentAllocator.create(
   				m_valuesStringPool.get(data, length),
   				this,
  -				theParentElement,
  +				theParentNode,
   				thePreviousSibling,
   				theNextSibling,
   				m_nextIndexValue++);
  @@ -880,11 +881,11 @@
   
   XalanSourceTreeProcessingInstruction*
   XalanSourceTreeDocument::createProcessingInstructionNode(
  -			const XalanDOMChar*			target,
  -			const XalanDOMChar*			data,
  -			XalanSourceTreeElement*		theParentElement,
  -			XalanNode*					thePreviousSibling,
  -			XalanNode*					theNextSibling)
  +			const XalanDOMChar*		target,
  +			const XalanDOMChar*		data,
  +			XalanNode*				theParentNode,
  +			XalanNode*				thePreviousSibling,
  +			XalanNode*				theNextSibling)
   {
   	assert(target != 0);
   	assert(data != 0);
  @@ -893,7 +894,7 @@
   				m_namesStringPool.get(target),
   				m_valuesStringPool.get(data),
   				this,
  -				theParentElement,
  +				theParentNode,
   				thePreviousSibling,
   				theNextSibling,
   				m_nextIndexValue++);
  @@ -966,7 +967,7 @@
   XalanSourceTreeDocument::createTextNode(
   			const XalanDOMChar*			chars,
   			XalanDOMString::size_type	length,
  -			XalanSourceTreeElement*		theParentElement,
  +			XalanNode*					theParentNode,
   			XalanNode*					thePreviousSibling,
   			XalanNode*					theNextSibling)
   {
  @@ -978,7 +979,7 @@
   
   		return m_textIWSAllocator.create(
   				theString,
  -				theParentElement,
  +				theParentNode,
   				thePreviousSibling,
   				theNextSibling,
   				m_nextIndexValue++);
  @@ -987,7 +988,7 @@
   	{
   		return m_textAllocator.create(
   				getTextNodeString(chars, length),
  -				theParentElement,
  +				theParentNode,
   				thePreviousSibling,
   				theNextSibling,
   				m_nextIndexValue++);
  @@ -1000,7 +1001,7 @@
   XalanSourceTreeDocument::createTextIWSNode(
   			const XalanDOMChar*			chars,
   			XalanDOMString::size_type	length,
  -			XalanSourceTreeElement*		theParentElement,
  +			XalanNode*					theParentNode,
   			XalanNode*					thePreviousSibling,
   			XalanNode*					theNextSibling)
   {
  @@ -1008,7 +1009,7 @@
   
   	return m_textIWSAllocator.create(
   			m_valuesStringPool.get(chars, length),
  -			theParentElement,
  +			theParentNode,
   			thePreviousSibling,
   			theNextSibling,
   			m_nextIndexValue++);
  @@ -1103,14 +1104,14 @@
   
   
   XalanSourceTreeElement*
  -XalanSourceTreeDocument::createElement(
  -			const XalanDOMChar*			theTagName,
  -			XalanSourceTreeAttr**		theAttributeVector,
  -			AttributesCountType			theAttributeCount,
  -			XalanSourceTreeElement*		theParentElement,
  -			XalanNode*					thePreviousSibling,
  -			XalanNode*					theNextSibling,
  -			const PrefixResolver&		thePrefixResolver)
  +XalanSourceTreeDocument::createElementNode(
  +			const XalanDOMChar*		theTagName,
  +			XalanSourceTreeAttr**	theAttributeVector,
  +			AttributesCountType		theAttributeCount,
  +			XalanNode*				theParentNode,
  +			XalanNode*				thePreviousSibling,
  +			XalanNode*				theNextSibling,
  +			const PrefixResolver&	thePrefixResolver)
   {
   	const XalanDOMString* const		theNamespace =
   		getNamespaceForPrefix(
  @@ -1129,7 +1130,7 @@
   				this,
   				theAttributeVector,
   				theAttributeCount,
  -				theParentElement,
  +				theParentNode,
   				thePreviousSibling,
   				theNextSibling,
   				m_nextIndexValue++);
  @@ -1167,7 +1168,7 @@
   				this,
   				theAttributeVector,
   				theAttributeCount,
  -				theParentElement,
  +				theParentNode,
   				thePreviousSibling,
   				theNextSibling,
   				m_nextIndexValue++);
  
  
  
  1.14      +25 -35    xml-xalan/c/src/XalanSourceTree/XalanSourceTreeDocument.hpp
  
  Index: XalanSourceTreeDocument.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeDocument.hpp,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- XalanSourceTreeDocument.hpp	2001/10/03 18:17:34	1.13
  +++ XalanSourceTreeDocument.hpp	2001/11/01 15:51:14	1.14
  @@ -340,12 +340,12 @@
   
   	XalanSourceTreeElement*
   	createElementNode(
  -			const XalanDOMChar*			name,
  -			const AttributeList&		attrs,
  -			XalanSourceTreeElement*		theParentElement = 0,
  -			XalanNode*					thePreviousSibling = 0,
  -			XalanNode*					theNextSibling = 0,
  -			bool						fAddXMLNamespaceAttribute = false);
  +			const XalanDOMChar*		name,
  +			const AttributeList&	attrs,
  +			XalanNode*				theParentNode = 0,
  +			XalanNode*				thePreviousSibling = 0,
  +			XalanNode*				theNextSibling = 0,
  +			bool					fAddXMLNamespaceAttribute = false);
   
   	XalanSourceTreeElement*
   	createElementNode(
  @@ -353,7 +353,7 @@
   			const XalanDOMChar*			localname,
   			const XalanDOMChar*			qname,
   			const Attributes&			attrs,
  -			XalanSourceTreeElement*		theParentElement = 0,
  +			XalanNode*					theParentNode = 0,
   			XalanNode*					thePreviousSibling = 0,
   			XalanNode*					theNextSibling = 0,
   			bool						fAddXMLNamespaceAttribute = false);
  @@ -363,7 +363,7 @@
   			const XalanDOMChar*			tagName,
   			const AttributeList&		attrs,
   			const PrefixResolver&		thePrefixResolver,
  -			XalanSourceTreeElement*		theParentElement = 0,
  +			XalanNode*					theParentNode = 0,
   			XalanNode*					thePreviousSibling = 0,
   			XalanNode*					theNextSibling = 0,
   			bool						fAddXMLNamespaceAttribute = false);
  @@ -372,7 +372,7 @@
   	createElementNode(
   			const XalanDOMChar*			name,
   			const Attributes&			attrs,
  -			XalanSourceTreeElement*		theParentElement = 0,
  +			XalanNode*					theParentNode = 0,
   			XalanNode*					thePreviousSibling = 0,
   			XalanNode*					theNextSibling = 0,
   			bool						fAddXMLNamespaceAttribute = false);
  @@ -381,23 +381,23 @@
   	createCommentNode(
   			const XalanDOMChar*			data,
   			XalanDOMString::size_type	length,
  -			XalanSourceTreeElement*		theParentElement = 0,
  +			XalanNode*					theParentNode = 0,
   			XalanNode*					thePreviousSibling = 0,
   			XalanNode*					theNextSibling = 0);
   
   	XalanSourceTreeProcessingInstruction*
   	createProcessingInstructionNode(
  -			const XalanDOMChar*			target,
  -			const XalanDOMChar*			data,
  -			XalanSourceTreeElement*		theParentElement = 0,
  -			XalanNode*					thePreviousSibling = 0,
  -			XalanNode*					theNextSibling = 0);
  +			const XalanDOMChar*		target,
  +			const XalanDOMChar*		data,
  +			XalanNode*				theParentNode = 0,
  +			XalanNode*				thePreviousSibling = 0,
  +			XalanNode*				theNextSibling = 0);
   
   	XalanSourceTreeText*
   	createTextNode(
   			const XalanDOMChar*			chars,
   			XalanDOMString::size_type	length,
  -			XalanSourceTreeElement*		theParentElement = 0,
  +			XalanNode*					theParentNode = 0,
   			XalanNode*					thePreviousSibling = 0,
   			XalanNode*					theNextSibling = 0);
   
  @@ -405,7 +405,7 @@
   	createTextIWSNode(
   			const XalanDOMChar*			chars,
   			XalanDOMString::size_type	length,
  -			XalanSourceTreeElement*		theParentElement = 0,
  +			XalanNode*					theParentNode = 0,
   			XalanNode*					thePreviousSibling = 0,
   			XalanNode*					theNextSibling = 0);
   
  @@ -445,25 +445,15 @@
   			const XalanDOMChar*			theValue,
   			XalanSourceTreeElement*		theOwnerElement);
   
  -	XalanSourceTreeElement*
  -	createElement(
  -			const XalanDOMChar*			theTagName,
  -			XalanSourceTreeAttr**		theAttributeVector,
  -			AttributesCountType			theAttributeCount,
  -			XalanSourceTreeElement*		theParentElement,
  -			XalanNode*					thePreviousSibling,
  -			XalanNode*					theNextSibling,
  -			bool						fAddXMLNamespaceAttribute);
  -
   	XalanSourceTreeElement*
  -	createElement(
  -			const XalanDOMChar*			theTagName,
  -			XalanSourceTreeAttr**		theAttributeVector,
  -			AttributesCountType			theAttributeCount,
  -			XalanSourceTreeElement*		theParentElement,
  -			XalanNode*					thePreviousSibling,
  -			XalanNode*					theNextSibling,
  -			const PrefixResolver&		thePrefixResolver);
  +	createElementNode(
  +			const XalanDOMChar*		theTagName,
  +			XalanSourceTreeAttr**	theAttributeVector,
  +			AttributesCountType		theAttributeCount,
  +			XalanNode*				theParentNode,
  +			XalanNode*				thePreviousSibling,
  +			XalanNode*				theNextSibling,
  +			const PrefixResolver&	thePrefixResolver);
   
   	void
   	createAttributes(
  
  
  
  1.2       +42 -26    xml-xalan/c/src/XalanSourceTree/XalanSourceTreeDocumentFragment.cpp
  
  Index: XalanSourceTreeDocumentFragment.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeDocumentFragment.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XalanSourceTreeDocumentFragment.cpp	2001/10/30 03:58:54	1.1
  +++ XalanSourceTreeDocumentFragment.cpp	2001/11/01 15:51:14	1.2
  @@ -69,27 +69,28 @@
   
   #include "XalanSourceTreeDocument.hpp"
   #include "XalanSourceTreeElement.hpp"
  +#include "XalanSourceTreeHelper.hpp"
   
   
   
  -static const XalanDOMChar		s_nameString[] = { XalanUnicode::charLetter_A, 0 };
  -static const AttributeListImpl	s_emptyAttributes;
   static const XalanDOMString		s_emptyString;
   
   
   
   XalanSourceTreeDocumentFragment::XalanSourceTreeDocumentFragment(XalanSourceTreeDocument&	theOwnerDocument) :
   	XalanDocumentFragment(),
  -	m_hostElement(theOwnerDocument.createElementNode(s_nameString, s_emptyAttributes))
  +	m_ownerDocument(&theOwnerDocument),
  +	m_firstChild(0)
   {
   }
   
   
   
   XalanSourceTreeDocumentFragment::XalanSourceTreeDocumentFragment(
  -			const XalanSourceTreeDocumentFragment&		theSource,
  -			bool										deep) :
  -	m_hostElement(theSource.m_hostElement->clone(deep))
  +			const XalanSourceTreeDocumentFragment&	theSource,
  +			bool									deep) :
  +	m_ownerDocument(theSource.m_ownerDocument),
  +	m_firstChild(theSource.m_firstChild == 0 ? 0 : theSource.m_firstChild->cloneNode(deep))
   {
   }
   
  @@ -136,7 +137,10 @@
   const XalanNodeList*
   XalanSourceTreeDocumentFragment::getChildNodes() const
   {
  -	return m_hostElement->getChildNodes();
  +	throw XalanDOMException(XalanDOMException::NOT_SUPPORTED_ERR);
  +
  +	// Dummy return value...
  +	return 0;
   }
   
   
  @@ -144,7 +148,7 @@
   XalanNode*
   XalanSourceTreeDocumentFragment::getFirstChild() const
   {
  -	return m_hostElement->getFirstChild();
  +	return m_firstChild;
   }
   
   
  @@ -152,7 +156,7 @@
   XalanNode*
   XalanSourceTreeDocumentFragment::getLastChild() const
   {
  -	return m_hostElement->getLastChild();
  +	return XalanSourceTreeHelper::getLastSibling(m_firstChild);
   }
   
   
  @@ -184,7 +188,7 @@
   XalanDocument*
   XalanSourceTreeDocumentFragment::getOwnerDocument() const
   {
  -	return m_hostElement->getOwnerDocument();
  +	return m_ownerDocument;
   }
   
   
  @@ -203,36 +207,48 @@
   
   XalanNode*
   XalanSourceTreeDocumentFragment::insertBefore(
  -			XalanNode*	newChild,
  -			XalanNode*	refChild)
  +			XalanNode*	/* newChild */,
  +			XalanNode*	/* refChild */)
   {
  -	return m_hostElement->insertBefore(newChild, refChild);
  +	throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  +
  +	// Dummy return value...
  +	return 0;
   }
   
   
   
   XalanNode*
   XalanSourceTreeDocumentFragment::replaceChild(
  -			XalanNode*	newChild,
  -			XalanNode*	oldChild)
  +			XalanNode*	/* newChild */,
  +			XalanNode*	/* oldChild */)
   {
  -	return m_hostElement->replaceChild(newChild, oldChild);
  +	throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  +
  +	// Dummy return value...
  +	return 0;
   }
   
   
   
   XalanNode*
  -XalanSourceTreeDocumentFragment::removeChild(XalanNode*	oldChild)
  +XalanSourceTreeDocumentFragment::removeChild(XalanNode*		/* oldChild */)
   {
  -	return m_hostElement->removeChild(oldChild);
  +	throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  +
  +	// Dummy return value...
  +	return 0;
   }
   
   
   
   XalanNode*
  -XalanSourceTreeDocumentFragment::appendChild(XalanNode*	newChild)
  +XalanSourceTreeDocumentFragment::appendChild(XalanNode*		/* newChild */)
   {
  -	return m_hostElement->appendChild(newChild);
  +	throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  +
  +	// Dummy return value...
  +	return 0;
   }
   
   
  @@ -240,7 +256,7 @@
   bool
   XalanSourceTreeDocumentFragment::hasChildNodes() const
   {
  -	return m_hostElement->hasChildNodes();
  +	return m_firstChild != 0 ? true : false;
   }
   
   
  @@ -322,7 +338,7 @@
   void
   XalanSourceTreeDocumentFragment::appendChildNode(XalanSourceTreeComment*	theChild)
   {
  -	m_hostElement->appendChildNode(theChild);
  +	XalanSourceTreeHelper::appendSiblingToChild(this, m_firstChild, theChild);
   }
   
   
  @@ -330,7 +346,7 @@
   void
   XalanSourceTreeDocumentFragment::appendChildNode(XalanSourceTreeElement*	theChild)
   {
  -	m_hostElement->appendChildNode(theChild);
  +	XalanSourceTreeHelper::appendSiblingToChild(this, m_firstChild, theChild);
   }
   
   
  @@ -338,7 +354,7 @@
   void
   XalanSourceTreeDocumentFragment::appendChildNode(XalanSourceTreeProcessingInstruction*	theChild)
   {
  -	m_hostElement->appendChildNode(theChild);
  +	XalanSourceTreeHelper::appendSiblingToChild(this, m_firstChild, theChild);
   }
   
   
  @@ -346,7 +362,7 @@
   void
   XalanSourceTreeDocumentFragment::appendChildNode(XalanSourceTreeText*	theChild)
   {
  -	m_hostElement->appendChildNode(theChild);
  +	XalanSourceTreeHelper::appendSiblingToChild(this, m_firstChild, theChild);
   }
   
   
  @@ -354,5 +370,5 @@
   void
   XalanSourceTreeDocumentFragment::clearChildren()
   {
  -	m_hostElement->clearChildren();
  +	m_firstChild = 0;
   }
  
  
  
  1.2       +3 -1      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeDocumentFragment.hpp
  
  Index: XalanSourceTreeDocumentFragment.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeDocumentFragment.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XalanSourceTreeDocumentFragment.hpp	2001/10/30 03:58:55	1.1
  +++ XalanSourceTreeDocumentFragment.hpp	2001/11/01 15:51:14	1.2
  @@ -211,7 +211,9 @@
   
   private:
   
  -	XalanSourceTreeElement*	const	m_hostElement;
  +	XalanSourceTreeDocument* const	m_ownerDocument;
  +
  +	XalanNode*						m_firstChild;
   };
   
   
  
  
  
  1.6       +14 -5     xml-xalan/c/src/XalanSourceTree/XalanSourceTreeElement.cpp
  
  Index: XalanSourceTreeElement.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeElement.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XalanSourceTreeElement.cpp	2001/10/30 03:59:43	1.5
  +++ XalanSourceTreeElement.cpp	2001/11/01 15:51:14	1.6
  @@ -69,6 +69,7 @@
   #include "XalanSourceTreeAttr.hpp"
   #include "XalanSourceTreeComment.hpp"
   #include "XalanSourceTreeDocument.hpp"
  +#include "XalanSourceTreeDocumentFragment.hpp"
   #include "XalanSourceTreeProcessingInstruction.hpp"
   #include "XalanSourceTreeText.hpp"
   #include "XalanSourceTreeHelper.hpp"
  @@ -84,14 +85,14 @@
   			XalanSourceTreeDocument*	theOwnerDocument,
   			XalanSourceTreeAttr**		theAttributes,
   			AttributesCountType			theAttributeCount,
  -			XalanSourceTreeElement*		theParentElement,
  +			XalanNode*					theParentNode,
   			XalanNode*					thePreviousSibling,
   			XalanNode*					theNextSibling,
   			unsigned int				theIndex) :
   	XalanElement(),
   	m_tagName(theTagName),
   	m_ownerDocument(theOwnerDocument),
  -	m_parentElement(theParentElement),
  +	m_parentNode(theParentNode),
   	m_previousSibling(thePreviousSibling),
   	m_nextSibling(theNextSibling),
   	m_firstChild(0),
  @@ -115,7 +116,7 @@
   	XalanElement(theSource),
   	m_tagName(theSource.m_tagName),
   	m_ownerDocument(theSource.m_ownerDocument),
  -	m_parentElement(0),
  +	m_parentNode(0),
   	m_previousSibling(0),
   	m_nextSibling(0),
   	m_firstChild(theSource.m_firstChild == 0 ? 0 : theSource.m_firstChild->cloneNode(deep)),
  @@ -154,9 +155,9 @@
   XalanNode*
   XalanSourceTreeElement::getParentNode() const
   {
  -	if (m_parentElement != 0)
  +	if (m_parentNode != 0)
   	{
  -		return m_parentElement;
  +		return m_parentNode;
   	}
   	else
   	{
  @@ -522,6 +523,14 @@
   			const XalanDOMString&	/* localName */) const
   {
   	return 0;
  +}
  +
  +
  +
  +void
  +XalanSourceTreeElement::setParent(XalanSourceTreeDocumentFragment*	theParent)
  +{
  +	m_parentNode = theParent;
   }
   
   
  
  
  
  1.5       +8 -10     xml-xalan/c/src/XalanSourceTree/XalanSourceTreeElement.hpp
  
  Index: XalanSourceTreeElement.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeElement.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XalanSourceTreeElement.hpp	2001/10/30 03:59:43	1.4
  +++ XalanSourceTreeElement.hpp	2001/11/01 15:51:14	1.5
  @@ -72,6 +72,7 @@
   class XalanSourceTreeAttr;
   class XalanSourceTreeComment;
   class XalanSourceTreeDocument;
  +class XalanSourceTreeDocumentFragment;
   class XalanSourceTreeProcessingInstruction;
   class XalanSourceTreeText;
   
  @@ -90,7 +91,7 @@
   	 * @param theOwnerDocument The document that owns the instance
   	 * @param theAttributes An array of pointers to the attribute instances for the element
   	 * @param theAttributeCount The number of attributes.
  -	 * @param theParentElement The parent element, if any.
  +	 * @param theParentNode The parent node, if any.
   	 * @param thePreviousSibling The previous sibling, if any.
   	 * @param theNextSibling The next sibling, if any.
   	 * @param theIndex The document-order index of the node.
  @@ -100,7 +101,7 @@
   			XalanSourceTreeDocument*	theOwnerDocument,
   			XalanSourceTreeAttr**		theAttributes,
   			AttributesCountType			theAttributeCount,
  -			XalanSourceTreeElement*		theParentElement = 0,
  +			XalanNode*					theParentNode = 0,
   			XalanNode*					thePreviousSibling = 0,
   			XalanNode*					theNextSibling = 0,
   			unsigned int				theIndex = 0);
  @@ -739,17 +740,14 @@
   		return m_ownerDocument;
   	}
   
  -	XalanSourceTreeElement*
  -	getParentElement() const
  +	void
  +	setParent(XalanSourceTreeElement*	theParent)
   	{
  -		return m_parentElement;
  +		m_parentNode = theParent;
   	}
   
   	void
  -	setParentElement(XalanSourceTreeElement*	theParent)
  -	{
  -		m_parentElement = theParent;
  -	}
  +	setParent(XalanSourceTreeDocumentFragment*	theParent);
   
   	void
   	setPreviousSibling(XalanSourceTreeComment*	thePreviousSibling);
  @@ -874,7 +872,7 @@
   
   	XalanSourceTreeDocument*		m_ownerDocument;
   
  -	XalanSourceTreeElement*			m_parentElement;
  +	XalanNode*						m_parentNode;
   
   	XalanNode*						m_previousSibling;
   
  
  
  
  1.3       +2 -2      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeElementAllocator.cpp
  
  Index: XalanSourceTreeElementAllocator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeElementAllocator.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XalanSourceTreeElementAllocator.cpp	2001/01/08 18:22:37	1.2
  +++ XalanSourceTreeElementAllocator.cpp	2001/11/01 15:51:14	1.3
  @@ -79,7 +79,7 @@
   			XalanSourceTreeDocument*	theOwnerDocument,
   			XalanSourceTreeAttr**		theAttributes,
   			AttributesCountType			theAttributeCount,
  -			XalanSourceTreeElement*		theParentElement,
  +			XalanNode*					theParentNode,
   			XalanNode*					thePreviousSibling,
   			XalanNode*					theNextSibling,
   			unsigned int				theIndex)
  @@ -92,7 +92,7 @@
   						theOwnerDocument,
   						theAttributes,
   						theAttributeCount,
  -						theParentElement,
  +						theParentNode,
   						thePreviousSibling,
   						theNextSibling,
   						theIndex);
  
  
  
  1.3       +2 -2      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeElementAllocator.hpp
  
  Index: XalanSourceTreeElementAllocator.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeElementAllocator.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XalanSourceTreeElementAllocator.hpp	2001/01/08 18:22:37	1.2
  +++ XalanSourceTreeElementAllocator.hpp	2001/11/01 15:51:14	1.3
  @@ -107,7 +107,7 @@
   	 * @param theOwnerDocument The document that owns the instance
   	 * @param theAttributes An array of pointers to the attribute instances for the element
   	 * @param theAttributeCount The number of attributes.
  -	 * @param theParentElement The parent element, if any.
  +	 * @param theParentNode The parent node, if any.
   	 * @param thePreviousSibling The previous sibling, if any.
   	 * @param theNextSibling The next sibling, if any.
   	 * @param theIndex The document-order index of the node.
  @@ -120,7 +120,7 @@
   			XalanSourceTreeDocument*	theOwnerDocument,
   			XalanSourceTreeAttr**		theAttributes,
   			AttributesCountType			theAttributeCount,
  -			XalanSourceTreeElement*		theParentElement = 0,
  +			XalanNode*					theParentNode = 0,
   			XalanNode*					thePreviousSibling = 0,
   			XalanNode*					theNextSibling = 0,
   			unsigned int				theIndex = 0);
  
  
  
  1.3       +2 -2      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeElementNS.cpp
  
  Index: XalanSourceTreeElementNS.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeElementNS.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XalanSourceTreeElementNS.cpp	2001/01/08 18:22:37	1.2
  +++ XalanSourceTreeElementNS.cpp	2001/11/01 15:51:14	1.3
  @@ -70,7 +70,7 @@
   			XalanSourceTreeDocument*	theOwnerDocument,
   			XalanSourceTreeAttr**		theAttributes,
   			AttributesCountType			theAttributeCount,
  -			XalanSourceTreeElement*		theParentElement,
  +			XalanNode*					theParentNode,
   			XalanNode*					thePreviousSibling,
   			XalanNode*					theNextSibling,
   			unsigned int				theIndex) :
  @@ -79,7 +79,7 @@
   		theOwnerDocument,
   		theAttributes,
   		theAttributeCount,
  -		theParentElement,
  +		theParentNode,
   		thePreviousSibling,
   		theNextSibling,
   		theIndex),
  
  
  
  1.3       +2 -2      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeElementNS.hpp
  
  Index: XalanSourceTreeElementNS.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeElementNS.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XalanSourceTreeElementNS.hpp	2001/01/08 18:22:37	1.2
  +++ XalanSourceTreeElementNS.hpp	2001/11/01 15:51:14	1.3
  @@ -81,7 +81,7 @@
   	 * @param theOwnerDocument The document that owns the instance
   	 * @param theAttributes An array of pointers to the attribute instances for the element
   	 * @param theAttributeCount The number of attributes.
  -	 * @param theParentElement The parent element, if any.
  +	 * @param theParentNode The parent node, if any.
   	 * @param thePreviousSibling The previous sibling, if any.
   	 * @param theNextSibling The next sibling, if any.
   	 * @param theIndex The document-order index of the node.
  @@ -94,7 +94,7 @@
   			XalanSourceTreeDocument*	theOwnerDocument,
   			XalanSourceTreeAttr**		theAttributes,
   			AttributesCountType			theAttributeCount,
  -			XalanSourceTreeElement*		theParentElement = 0,
  +			XalanNode*					theParentNode = 0,
   			XalanNode*					thePreviousSibling = 0,
   			XalanNode*					theNextSibling = 0,
   			unsigned int				theIndex = 0);
  
  
  
  1.3       +2 -2      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeElementNSAllocator.cpp
  
  Index: XalanSourceTreeElementNSAllocator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeElementNSAllocator.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XalanSourceTreeElementNSAllocator.cpp	2001/01/08 18:22:37	1.2
  +++ XalanSourceTreeElementNSAllocator.cpp	2001/11/01 15:51:14	1.3
  @@ -82,7 +82,7 @@
   			XalanSourceTreeDocument*	theOwnerDocument,
   			XalanSourceTreeAttr**		theAttributes,
   			AttributesCountType			theAttributeCount,
  -			XalanSourceTreeElement*		theParentElement,
  +			XalanNode*					theParentNode,
   			XalanNode*					thePreviousSibling,
   			XalanNode*					theNextSibling,
   			unsigned int				theIndex)
  @@ -98,7 +98,7 @@
   						theOwnerDocument,
   						theAttributes,
   						theAttributeCount,
  -						theParentElement,
  +						theParentNode,
   						thePreviousSibling,
   						theNextSibling,
   						theIndex);
  
  
  
  1.3       +2 -2      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeElementNSAllocator.hpp
  
  Index: XalanSourceTreeElementNSAllocator.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeElementNSAllocator.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XalanSourceTreeElementNSAllocator.hpp	2001/01/08 18:22:37	1.2
  +++ XalanSourceTreeElementNSAllocator.hpp	2001/11/01 15:51:14	1.3
  @@ -110,7 +110,7 @@
   	 * @param theOwnerDocument The document that owns the instance
   	 * @param theAttributes An array of pointers to the attribute instances for the element
   	 * @param theAttributeCount The number of attributes.
  -	 * @param theParentElement The parent element, if any.
  +	 * @param theParentNode The parent node, if any.
   	 * @param thePreviousSibling The previous sibling, if any.
   	 * @param theNextSibling The next sibling, if any.
   	 * @param theIndex The document-order index of the node.
  @@ -126,7 +126,7 @@
   			XalanSourceTreeDocument*	theOwnerDocument,
   			XalanSourceTreeAttr**		theAttributes,
   			AttributesCountType			theAttributeCount,
  -			XalanSourceTreeElement*		theParentElement = 0,
  +			XalanNode*					theParentNode = 0,
   			XalanNode*					thePreviousSibling = 0,
   			XalanNode*					theNextSibling = 0,
   			unsigned int				theIndex = 0);
  
  
  
  1.5       +75 -2     xml-xalan/c/src/XalanSourceTree/XalanSourceTreeHelper.cpp
  
  Index: XalanSourceTreeHelper.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeHelper.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XalanSourceTreeHelper.cpp	2001/01/16 02:52:35	1.4
  +++ XalanSourceTreeHelper.cpp	2001/11/01 15:51:14	1.5
  @@ -69,6 +69,7 @@
   
   #include "XalanSourceTreeComment.hpp"
   #include "XalanSourceTreeDocument.hpp"
  +#include "XalanSourceTreeDocumentFragment.hpp"
   #include "XalanSourceTreeElement.hpp"
   #include "XalanSourceTreeProcessingInstruction.hpp"
   #include "XalanSourceTreeText.hpp"
  @@ -427,9 +428,9 @@
   	assert(theOwnerElement != 0);
   	assert(theNewSibling != 0);
   
  -	if (theNewSibling->getParentElement() != theOwnerElement)
  +	if (theNewSibling->getParentNode() != theOwnerElement)
   	{
  -		theNewSibling->setParentElement(theOwnerElement);
  +		theNewSibling->setParent(theOwnerElement);
   	}
   
   	if (theFirstChildSlot == 0)
  @@ -446,6 +447,35 @@
   
   
   
  +template <class NodeType>
  +void
  +doAppendSiblingToChild(
  +			XalanSourceTreeDocumentFragment*	theOwnerDocumentFragment,
  +			XalanNode*&							theFirstChildSlot,
  +			NodeType*							theNewSibling)
  +{
  +	assert(theOwnerDocumentFragment != 0);
  +	assert(theNewSibling != 0);
  +
  +	if (theNewSibling->getParentNode() != theOwnerDocumentFragment)
  +	{
  +		theNewSibling->setParent(theOwnerDocumentFragment);
  +	}
  +
  +	if (theFirstChildSlot == 0)
  +	{
  +		append(theFirstChildSlot, theNewSibling);
  +	}
  +	else
  +	{
  +		XalanNode* const	theLastSibling = doGetLastSibling(theFirstChildSlot);
  +
  +		doAppendSibling(theLastSibling, theNewSibling);	
  +	}
  +}
  +
  +
  +
   void
   XalanSourceTreeHelper::appendSiblingToChild(
   			XalanSourceTreeElement*		theOwnerElement,
  @@ -488,6 +518,49 @@
   	doAppendSiblingToChild(theOwnerElement, theFirstChildSlot, theNewSibling);
   }
   
  +
  +
  +void
  +XalanSourceTreeHelper::appendSiblingToChild(
  +			XalanSourceTreeDocumentFragment*	theOwnerDocumentFragment,
  +			XalanNode*&							theFirstChildSlot,
  +			XalanSourceTreeComment*				theNewSibling)
  +{
  +	doAppendSiblingToChild(theOwnerDocumentFragment, theFirstChildSlot, theNewSibling);
  +}
  +
  +
  +
  +void
  +XalanSourceTreeHelper::appendSiblingToChild(
  +			XalanSourceTreeDocumentFragment*	theOwnerDocumentFragment,
  +			XalanNode*&							theFirstChildSlot,
  +			XalanSourceTreeElement*				theNewSibling)
  +{
  +	doAppendSiblingToChild(theOwnerDocumentFragment, theFirstChildSlot, theNewSibling);
  +}
  +
  +
  +
  +void
  +XalanSourceTreeHelper::appendSiblingToChild(
  +			XalanSourceTreeDocumentFragment*		theOwnerDocumentFragment,
  +			XalanNode*&								theFirstChildSlot,
  +			XalanSourceTreeProcessingInstruction*	theNewSibling)
  +{
  +	doAppendSiblingToChild(theOwnerDocumentFragment, theFirstChildSlot, theNewSibling);
  +}
  +
  +
  +
  +void
  +XalanSourceTreeHelper::appendSiblingToChild(
  +			XalanSourceTreeDocumentFragment*	theOwnerDocumentFragment,
  +			XalanNode*&							theFirstChildSlot,
  +			XalanSourceTreeText*				theNewSibling)
  +{
  +	doAppendSiblingToChild(theOwnerDocumentFragment, theFirstChildSlot, theNewSibling);
  +}
   
   
   
  
  
  
  1.4       +29 -4     xml-xalan/c/src/XalanSourceTree/XalanSourceTreeHelper.hpp
  
  Index: XalanSourceTreeHelper.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeHelper.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XalanSourceTreeHelper.hpp	2001/01/16 02:52:35	1.3
  +++ XalanSourceTreeHelper.hpp	2001/11/01 15:51:14	1.4
  @@ -70,6 +70,7 @@
   class XalanNode;
   class XalanSourceTreeComment;
   class XalanSourceTreeDocument;
  +class XalanSourceTreeDocumentFragment;
   class XalanSourceTreeElement;
   class XalanSourceTreeProcessingInstruction;
   class XalanSourceTreeText;
  @@ -138,27 +139,51 @@
   	static void
   	appendSiblingToChild(
   			XalanSourceTreeElement*		theOwnerElement,
  -			XalanNode*&					theChildSlot,
  +			XalanNode*&					theFirstChildSlot,
   			XalanSourceTreeComment*		theNewSibling);
   
   
   	static void
   	appendSiblingToChild(
   			XalanSourceTreeElement*		theOwnerElement,
  -			XalanNode*&					theChildSlot,
  +			XalanNode*&					theFirstChildSlot,
   			XalanSourceTreeElement*		theNewSibling);
   
   	static void
   	appendSiblingToChild(
   			XalanSourceTreeElement*					theOwnerElement,
  -			XalanNode*&								theChildSlot,
  +			XalanNode*&								theFirstChildSlot,
   			XalanSourceTreeProcessingInstruction*	theNewSibling);
   
   	static void
   	appendSiblingToChild(
   			XalanSourceTreeElement*		theOwnerElement,
  -			XalanNode*&					theChildSlot,
  +			XalanNode*&					theFirstChildSlot,
   			XalanSourceTreeText*		theNewSibling);
  +
  +	static void
  +	appendSiblingToChild(
  +			XalanSourceTreeDocumentFragment*	theOwnerDocumentFragment,
  +			XalanNode*&							theFirstChildSlot,
  +			XalanSourceTreeComment*				theNewSibling);
  +
  +	static void
  +	appendSiblingToChild(
  +			XalanSourceTreeDocumentFragment*	theOwnerDocumentFragment,
  +			XalanNode*&							theFirstChildSlot,
  +			XalanSourceTreeElement*				theNewSibling);
  +
  +	static void
  +	appendSiblingToChild(
  +			XalanSourceTreeDocumentFragment*		theOwnerDocumentFragment,
  +			XalanNode*&								theFirstChildSlot,
  +			XalanSourceTreeProcessingInstruction*	theNewSibling);
  +
  +	static void
  +	appendSiblingToChild(
  +			XalanSourceTreeDocumentFragment*	theOwnerDocumentFragment,
  +			XalanNode*&							theFirstChildSlot,
  +			XalanSourceTreeText*				theNewSibling);
   
   private:
   
  
  
  
  1.5       +22 -5     xml-xalan/c/src/XalanSourceTree/XalanSourceTreeProcessingInstruction.cpp
  
  Index: XalanSourceTreeProcessingInstruction.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeProcessingInstruction.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XalanSourceTreeProcessingInstruction.cpp	2001/01/18 22:34:30	1.4
  +++ XalanSourceTreeProcessingInstruction.cpp	2001/11/01 15:51:14	1.5
  @@ -68,6 +68,7 @@
   
   #include "XalanSourceTreeComment.hpp"
   #include "XalanSourceTreeDocument.hpp"
  +#include "XalanSourceTreeDocumentFragment.hpp"
   #include "XalanSourceTreeElement.hpp"
   #include "XalanSourceTreeText.hpp"
   #include "XalanSourceTreeHelper.hpp"
  @@ -82,7 +83,7 @@
   			const XalanDOMString&		theTarget,
   			const XalanDOMString&		theData,
   			XalanSourceTreeDocument*	theOwnerDocument,
  -			XalanSourceTreeElement*		theParentElement,
  +			XalanNode*					theParentNode,
   			XalanNode*					thePreviousSibling,
   			XalanNode*					theNextSibling,
   			unsigned int				theIndex) :
  @@ -90,7 +91,7 @@
   	m_target(theTarget),
   	m_data(theData),
   	m_ownerDocument(theOwnerDocument),
  -	m_parentElement(theParentElement),
  +	m_parentNode(theParentNode),
   	m_previousSibling(thePreviousSibling),
   	m_nextSibling(theNextSibling),
   	m_index(theIndex)
  @@ -111,7 +112,7 @@
   	XalanProcessingInstruction(theSource),
   	m_target(theSource.m_target),
   	m_data(theSource.m_data),
  -	m_parentElement(0),
  +	m_parentNode(0),
   	m_previousSibling(0),
   	m_nextSibling(0),
   	m_index(0)
  @@ -147,9 +148,9 @@
   XalanNode*
   XalanSourceTreeProcessingInstruction::getParentNode() const
   {
  -	if (m_parentElement != 0)
  +	if (m_parentNode != 0)
   	{
  -		return m_parentElement;
  +		return m_parentNode;
   	}
   	else
   	{
  @@ -382,6 +383,22 @@
   XalanSourceTreeProcessingInstruction::setData(const XalanDOMString&		/* theData */)
   {
   	throw XalanDOMException(XalanDOMException::NO_MODIFICATION_ALLOWED_ERR);
  +}
  +
  +
  +
  +void
  +XalanSourceTreeProcessingInstruction::setParent(XalanSourceTreeElement*	theParent)
  +{
  +	m_parentNode = theParent;
  +}
  +
  +
  +
  +void
  +XalanSourceTreeProcessingInstruction::setParent(XalanSourceTreeDocumentFragment*	theParent)
  +{
  +	m_parentNode = theParent;
   }
   
   
  
  
  
  1.3       +7 -12     xml-xalan/c/src/XalanSourceTree/XalanSourceTreeProcessingInstruction.hpp
  
  Index: XalanSourceTreeProcessingInstruction.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeProcessingInstruction.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XalanSourceTreeProcessingInstruction.hpp	2000/12/17 22:27:00	1.2
  +++ XalanSourceTreeProcessingInstruction.hpp	2001/11/01 15:51:14	1.3
  @@ -73,6 +73,7 @@
   
   class XalanSourceTreeComment;
   class XalanSourceTreeDocument;
  +class XalanSourceTreeDocumentFragment;
   class XalanSourceTreeElement;
   class XalanSourceTreeText;
   
  @@ -88,7 +89,7 @@
   	 * @param theTarget The target for the processing instruction.
   	 * @param theData The data for the node
   	 * @param theOwnerDocument The document that owns the instance.
  -	 * @param theParentElement The parent element, if any.
  +	 * @param theParentNode The parent node, if any.
   	 * @param thePreviousSibling The next sibling, if any.
   	 * @param theNextSibling The next sibling, if any.
   	 * @param theIndex The document-order index of the node.
  @@ -99,7 +100,7 @@
   			const XalanDOMString&		theTarget,
   			const XalanDOMString&		theData,
   			XalanSourceTreeDocument*	theOwnerDocument,
  -			XalanSourceTreeElement*		theParentElement = 0,
  +			XalanNode*					theParentNode = 0,
   			XalanNode*					thePreviousSibling = 0,
   			XalanNode*					theNextSibling = 0,
   			unsigned int				theIndex = 0);
  @@ -494,17 +495,11 @@
   
   	// public interfaces not inherited from XalanProcessingInstruction...
   
  -	XalanSourceTreeElement*
  -	getParentElement() const
  -	{
  -		return m_parentElement;
  -	}
  +	void
  +	setParent(XalanSourceTreeElement*	theParent);
   
   	void
  -	setParentElement(XalanSourceTreeElement*	theParentElement)
  -	{
  -		m_parentElement = theParentElement;
  -	}
  +	setParent(XalanSourceTreeDocumentFragment*	theParent);
   
   	void
   	setPreviousSibling(XalanSourceTreeComment*	thePreviousSibling);
  @@ -559,7 +554,7 @@
   
   	XalanSourceTreeDocument*	m_ownerDocument;
   
  -	XalanSourceTreeElement*		m_parentElement;
  +	XalanNode*					m_parentNode;
   
   	XalanNode*					m_previousSibling;
   
  
  
  
  1.2       +2 -2      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeProcessingInstructionAllocator.cpp
  
  Index: XalanSourceTreeProcessingInstructionAllocator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeProcessingInstructionAllocator.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XalanSourceTreeProcessingInstructionAllocator.cpp	2000/12/15 23:24:12	1.1
  +++ XalanSourceTreeProcessingInstructionAllocator.cpp	2001/11/01 15:51:14	1.2
  @@ -78,7 +78,7 @@
   			const XalanDOMString&		theTarget,
   			const XalanDOMString&		theData,
   			XalanSourceTreeDocument*	theOwnerDocument,
  -			XalanSourceTreeElement*		theParentElement,
  +			XalanNode*					theParentNode,
   			XalanNode*					thePreviousSibling,
   			XalanNode*					theNextSibling,
   			unsigned int				theIndex)
  @@ -90,7 +90,7 @@
   						theTarget,
   						theData,
   						theOwnerDocument,
  -						theParentElement,
  +						theParentNode,
   						thePreviousSibling,
   						theNextSibling,
   						theIndex);
  
  
  
  1.2       +2 -2      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeProcessingInstructionAllocator.hpp
  
  Index: XalanSourceTreeProcessingInstructionAllocator.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeProcessingInstructionAllocator.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XalanSourceTreeProcessingInstructionAllocator.hpp	2000/12/15 23:24:12	1.1
  +++ XalanSourceTreeProcessingInstructionAllocator.hpp	2001/11/01 15:51:14	1.2
  @@ -104,7 +104,7 @@
   	 * @param theTarget The target for the processing instruction.
   	 * @param theData The data for the node
   	 * @param theOwnerDocument The document that owns the instance.
  -	 * @param theParentElement The parent element, if any.
  +	 * @param theParentNode The parent node, if any.
   	 * @param thePreviousSibling The next sibling, if any.
   	 * @param theNextSibling The next sibling, if any.
   	 * @param theIndex The document-order index of the node.
  @@ -116,7 +116,7 @@
   			const XalanDOMString&		theTarget,
   			const XalanDOMString&		theData,
   			XalanSourceTreeDocument*	theOwnerDocument,
  -			XalanSourceTreeElement*		theParentElement = 0,
  +			XalanNode*					theParentNode = 0,
   			XalanNode*					thePreviousSibling = 0,
   			XalanNode*					theNextSibling = 0,
   			unsigned int				theIndex = 0);
  
  
  
  1.8       +28 -11    xml-xalan/c/src/XalanSourceTree/XalanSourceTreeText.cpp
  
  Index: XalanSourceTreeText.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeText.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XalanSourceTreeText.cpp	2001/09/25 21:13:05	1.7
  +++ XalanSourceTreeText.cpp	2001/11/01 15:51:14	1.8
  @@ -67,6 +67,7 @@
   
   
   #include "XalanSourceTreeComment.hpp"
  +#include "XalanSourceTreeDocumentFragment.hpp"
   #include "XalanSourceTreeElement.hpp"
   #include "XalanSourceTreeProcessingInstruction.hpp"
   #include "XalanSourceTreeHelper.hpp"
  @@ -78,14 +79,14 @@
   
   
   XalanSourceTreeText::XalanSourceTreeText(
  -			const XalanDOMString&		theData,
  -			XalanSourceTreeElement*		theParentElement,
  -			XalanNode*					thePreviousSibling,
  -			XalanNode*					theNextSibling,
  -			unsigned int				theIndex) :
  +			const XalanDOMString&	theData,
  +			XalanNode*				theParentNode,
  +			XalanNode*				thePreviousSibling,
  +			XalanNode*				theNextSibling,
  +			unsigned int			theIndex) :
   	XalanText(),
   	m_data(theData),
  -	m_parentElement(theParentElement),
  +	m_parentNode(theParentNode),
   	m_previousSibling(thePreviousSibling),
   	m_nextSibling(theNextSibling),
   	m_index(theIndex)
  @@ -102,10 +103,10 @@
   
   XalanSourceTreeText::XalanSourceTreeText(
   			const XalanSourceTreeText&	theSource,
  -			bool							/* deep */) :
  +			bool						/* deep */) :
   	XalanText(theSource),
   	m_data(theSource.m_data),
  -	m_parentElement(0),
  +	m_parentNode(0),
   	m_previousSibling(0),
   	m_nextSibling(0),
   	m_index(0)
  @@ -141,7 +142,7 @@
   XalanNode*
   XalanSourceTreeText::getParentNode() const
   {
  -	return m_parentElement;
  +	return m_parentNode;
   }
   
   
  @@ -200,9 +201,9 @@
   XalanDocument*
   XalanSourceTreeText::getOwnerDocument() const
   {
  -	assert(m_parentElement != 0);
  +	assert(m_parentNode != 0);
   
  -	return m_parentElement->getOwnerDocument();
  +	return m_parentNode->getOwnerDocument();
   }
   
   
  @@ -429,6 +430,22 @@
   XalanSourceTreeText::isIgnorableWhitespace() const
   {
   	return false;
  +}
  +
  +
  +
  +void
  +XalanSourceTreeText::setParent(XalanSourceTreeElement*	theParent)
  +{
  +	m_parentNode = theParent;
  +}
  +
  +
  +
  +void
  +XalanSourceTreeText::setParent(XalanSourceTreeDocumentFragment*	theParent)
  +{
  +	m_parentNode = theParent;
   }
   
   
  
  
  
  1.3       +11 -16    xml-xalan/c/src/XalanSourceTree/XalanSourceTreeText.hpp
  
  Index: XalanSourceTreeText.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeText.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XalanSourceTreeText.hpp	2000/12/17 22:27:00	1.2
  +++ XalanSourceTreeText.hpp	2001/11/01 15:51:14	1.3
  @@ -72,6 +72,7 @@
   
   
   class XalanSourceTreeComment;
  +class XalanSourceTreeDocumentFragment;
   class XalanSourceTreeElement;
   class XalanSourceTreeProcessingInstruction;
   
  @@ -98,17 +99,17 @@
   	 *
   	 * @param theData The text data of the node
   	 * @param isIgnorableWhitespace true if the text data is only ignorable whitespace
  -	 * @param theParentElement The parent element, if any.
  +	 * @param theParentNode The parent node, if any.
   	 * @param thePreviousSibling The previous sibling, if any.
   	 * @param theNextSibling The next sibling, if any.
   	 * @param theIndex The document-order index of the node.
   	 */
   	XalanSourceTreeText(
  -			const XalanDOMString&		theData,
  -			XalanSourceTreeElement*		theParentElement = 0,
  -			XalanNode*					thePreviousSibling = 0,
  -			XalanNode*					theNextSibling = 0,
  -			unsigned int				theIndex = 0);
  +			const XalanDOMString&	theData,
  +			XalanNode*				theParentNode = 0,
  +			XalanNode*				thePreviousSibling = 0,
  +			XalanNode*				theNextSibling = 0,
  +			unsigned int			theIndex = 0);
   
   	virtual
   	~XalanSourceTreeText();
  @@ -619,17 +620,11 @@
   
   	// public interfaces not inherited from XalanCDATASection...
   
  -	XalanSourceTreeElement*
  -	getParentElement() const
  -	{
  -		return m_parentElement;
  -	}
  +	void
  +	setParent(XalanSourceTreeElement*	theParent);
   
   	void
  -	setParentElement(XalanSourceTreeElement*	theParentElement)
  -	{
  -		m_parentElement = theParentElement;
  -	}
  +	setParent(XalanSourceTreeDocumentFragment*	theParent);
   
   	void
   	setPreviousSibling(XalanSourceTreeComment*	thePreviousSibling);
  @@ -680,7 +675,7 @@
   	// Data members...
   	const XalanDOMString&			m_data;
   
  -	XalanSourceTreeElement*			m_parentElement;
  +	XalanNode*						m_parentNode;
   
   	XalanNode*						m_previousSibling;
   
  
  
  
  1.2       +6 -6      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeTextAllocator.cpp
  
  Index: XalanSourceTreeTextAllocator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeTextAllocator.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XalanSourceTreeTextAllocator.cpp	2000/12/15 23:24:12	1.1
  +++ XalanSourceTreeTextAllocator.cpp	2001/11/01 15:51:14	1.2
  @@ -75,18 +75,18 @@
   
   XalanSourceTreeTextAllocator::ObjectType*
   XalanSourceTreeTextAllocator::create(
  -			const XalanDOMString&		theData,
  -			XalanSourceTreeElement*		theParentElement,
  -			XalanNode*					thePreviousSibling,
  -			XalanNode*					theNextSibling,
  -			unsigned int				theIndex)
  +			const XalanDOMString&	theData,
  +			XalanNode*				theParentNode,
  +			XalanNode*				thePreviousSibling,
  +			XalanNode*				theNextSibling,
  +			unsigned int			theIndex)
   {
   	ObjectType* const	theBlock = m_allocator.allocateBlock();
   	assert(theBlock != 0);
   
   	new(theBlock) ObjectType(
   						theData,
  -						theParentElement,
  +						theParentNode,
   						thePreviousSibling,
   						theNextSibling,
   						theIndex);
  
  
  
  1.2       +6 -6      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeTextAllocator.hpp
  
  Index: XalanSourceTreeTextAllocator.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeTextAllocator.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XalanSourceTreeTextAllocator.hpp	2000/12/15 23:24:12	1.1
  +++ XalanSourceTreeTextAllocator.hpp	2001/11/01 15:51:14	1.2
  @@ -102,7 +102,7 @@
   	 * Create an instance.
   	 * 
   	 * @param theData The data for the node
  -	 * @param theParentElement The parent element, if any.
  +	 * @param theParentNode The parent node, if any.
   	 * @param thePreviousSibling The next sibling, if any.
   	 * @param theNextSibling The next sibling, if any.
   	 * @param theIndex The document-order index of the node.
  @@ -111,11 +111,11 @@
   	 */
   	ObjectType*
   	create(
  -			const XalanDOMString&		theData,
  -			XalanSourceTreeElement*		theParentElement = 0,
  -			XalanNode*					thePreviousSibling = 0,
  -			XalanNode*					theNextSibling = 0,
  -			unsigned int				theIndex = 0);
  +			const XalanDOMString&	theData,
  +			XalanNode*				theParentNode = 0,
  +			XalanNode*				thePreviousSibling = 0,
  +			XalanNode*				theNextSibling = 0,
  +			unsigned int			theIndex = 0);
   
   	/**
   	 * Delete all objects from allocator.	 
  
  
  
  1.2       +6 -6      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeTextIWS.cpp
  
  Index: XalanSourceTreeTextIWS.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeTextIWS.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XalanSourceTreeTextIWS.cpp	2000/12/15 23:24:12	1.1
  +++ XalanSourceTreeTextIWS.cpp	2001/11/01 15:51:14	1.2
  @@ -59,12 +59,12 @@
   
   
   XalanSourceTreeTextIWS::XalanSourceTreeTextIWS(
  -			const XalanDOMString&		theData,
  -			XalanSourceTreeElement*		theParentElement,
  -			XalanNode*					thePreviousSibling,
  -			XalanNode*					theNextSibling,
  -			unsigned int				theIndex) :
  -	XalanSourceTreeText(theData, theParentElement, thePreviousSibling, theNextSibling, theIndex)
  +			const XalanDOMString&	theData,
  +			XalanNode*				theParentNode,
  +			XalanNode*				thePreviousSibling,
  +			XalanNode*				theNextSibling,
  +			unsigned int			theIndex) :
  +	XalanSourceTreeText(theData, theParentNode, thePreviousSibling, theNextSibling, theIndex)
   {
   }
   
  
  
  
  1.2       +6 -7      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeTextIWS.hpp
  
  Index: XalanSourceTreeTextIWS.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeTextIWS.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XalanSourceTreeTextIWS.hpp	2000/12/15 23:24:12	1.1
  +++ XalanSourceTreeTextIWS.hpp	2001/11/01 15:51:14	1.2
  @@ -75,17 +75,17 @@
   	 * Constructor.
   	 *
   	 * @param theData The text data of the node
  -	 * @param theParentElement The parent element, if any.
  +	 * @param theParentNode The parent node, if any.
   	 * @param thePreviousSibling The previous sibling, if any.
   	 * @param theNextSibling The next sibling, if any.
   	 * @param theIndex The document-order index of the node.
   	 */
   	XalanSourceTreeTextIWS(
  -			const XalanDOMString&		theData,
  -			XalanSourceTreeElement*		theParentElement = 0,
  -			XalanNode*					thePreviousSibling = 0,
  -			XalanNode*					theNextSibling = 0,
  -			unsigned int				theIndex = 0);
  +			const XalanDOMString&	theData,
  +			XalanNode*				theParentNode = 0,
  +			XalanNode*				thePreviousSibling = 0,
  +			XalanNode*				theNextSibling = 0,
  +			unsigned int			theIndex = 0);
   
   	virtual
   	~XalanSourceTreeTextIWS();
  @@ -108,7 +108,6 @@
   
   	bool
   	operator==(const XalanSourceTreeTextIWS&	theRHS) const;
  -
   
   	// Data members...
   };
  
  
  
  1.2       +6 -6      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeTextIWSAllocator.cpp
  
  Index: XalanSourceTreeTextIWSAllocator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeTextIWSAllocator.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XalanSourceTreeTextIWSAllocator.cpp	2000/12/15 23:24:12	1.1
  +++ XalanSourceTreeTextIWSAllocator.cpp	2001/11/01 15:51:14	1.2
  @@ -75,18 +75,18 @@
   
   XalanSourceTreeTextIWSAllocator::ObjectType*
   XalanSourceTreeTextIWSAllocator::create(
  -			const XalanDOMString&		theData,
  -			XalanSourceTreeElement*		theParentElement,
  -			XalanNode*					thePreviousSibling,
  -			XalanNode*					theNextSibling,
  -			unsigned int				theIndex)
  +			const XalanDOMString&	theData,
  +			XalanNode*				theParentNode,
  +			XalanNode*				thePreviousSibling,
  +			XalanNode*				theNextSibling,
  +			unsigned int			theIndex)
   {
   	ObjectType* const	theBlock = m_allocator.allocateBlock();
   	assert(theBlock != 0);
   
   	new(theBlock) ObjectType(
   						theData,
  -						theParentElement,
  +						theParentNode,
   						thePreviousSibling,
   						theNextSibling,
   						theIndex);
  
  
  
  1.2       +6 -6      xml-xalan/c/src/XalanSourceTree/XalanSourceTreeTextIWSAllocator.hpp
  
  Index: XalanSourceTreeTextIWSAllocator.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeTextIWSAllocator.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XalanSourceTreeTextIWSAllocator.hpp	2000/12/15 23:24:12	1.1
  +++ XalanSourceTreeTextIWSAllocator.hpp	2001/11/01 15:51:14	1.2
  @@ -102,7 +102,7 @@
   	 * Create an instance.
   	 * 
   	 * @param theData The data for the node
  -	 * @param theParentElement The parent element, if any.
  +	 * @param theParentNode The parent node, if any.
   	 * @param thePreviousSibling The next sibling, if any.
   	 * @param theNextSibling The next sibling, if any.
   	 * @param theIndex The document-order index of the node.
  @@ -111,11 +111,11 @@
   	 */
   	ObjectType*
   	create(
  -			const XalanDOMString&		theData,
  -			XalanSourceTreeElement*		theParentElement = 0,
  -			XalanNode*					thePreviousSibling = 0,
  -			XalanNode*					theNextSibling = 0,
  -			unsigned int				theIndex = 0);
  +			const XalanDOMString&	theData,
  +			XalanNode*				theParentNode = 0,
  +			XalanNode*				thePreviousSibling = 0,
  +			XalanNode*				theNextSibling = 0,
  +			unsigned int			theIndex = 0);
   
   	/**
   	 * Delete all objects from allocator.	 
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org