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...@locus.apache.org on 2000/05/05 17:14:27 UTC

cvs commit: xml-xalan/c/src/XSLT StylesheetRoot.cpp XSLTResultTarget.hpp

dbertoni    00/05/05 08:14:26

  Modified:    c/src/XSLT StylesheetRoot.cpp XSLTResultTarget.hpp
  Log:
  Changed XSLTResultTarget so that it requires a FormatterListener, not a DocumentHandler.
  
  Revision  Changes    Path
  1.12      +19 -18    xml-xalan/c/src/XSLT/StylesheetRoot.cpp
  
  Index: StylesheetRoot.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetRoot.cpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- StylesheetRoot.cpp	2000/04/25 19:54:16	1.11
  +++ StylesheetRoot.cpp	2000/05/05 15:14:26	1.12
  @@ -212,27 +212,28 @@
   
   		Writer* pw = 0;
   
  -		/*
  -		 * Output target has a document handler
  -		 */
  -		if(0 != outputTarget.getDocumentHandler())
  +		flistener = outputTarget.getFormatterListener();
  +
  +		if(flistener == 0)
   		{
  -			// Stuff a DocumentHandler into a FormatterListener
  -			flistener =
  -#if defined(XALAN_OLD_STYLE_CASTS) || !defined(XALAN_RTTI_AVAILABLE)
  -				(FormatterListener*)outputTarget.getDocumentHandler();
  -#else
  -				dynamic_cast<FormatterListener*>(outputTarget.getDocumentHandler());
  -#endif
  +			// $$$ ToDo: For right now, XSLTResultTarget::getDocumentHandler()
  +			// and XSLTResultTarget::getFormatterListener() both return a
  +			// FormatterListener*.  When we have RTTI on all platforms, that
  +			// may change...
  +			flistener = outputTarget.getDocumentHandler();
   		}
  +
  +		if (flistener != 0)
  +		{
  +			// Do encoding stuff here...
  +		}
   		/*
   		 * Output target has a character or byte stream or file
   		 */
  -		else if((0 != outputTarget.getCharacterStream()) || 
  -						(0 != outputTarget.getByteStream()) || 
  +		else if((0 != outputTarget.getCharacterStream()) ||
  +						(0 != outputTarget.getByteStream()) ||
   						(0 != outputTarget.getFileName().length()))
   		{
  -
   			if(0 != outputTarget.getCharacterStream())
   			{
   				pw = outputTarget.getCharacterStream();
  @@ -272,12 +273,12 @@
   					pw = executionContext.createPrintWriter(cout);
   				}
   			}
  -			
  -			int indentAmount = executionContext.getIndent();
  -			bool doIndent = (indentAmount > -1) ? true : m_indentResult;
  +
  +			int			indentAmount = executionContext.getIndent();
  +			const bool	doIndent = (indentAmount > -1) ? true : m_indentResult;
   			// Make sure we don't have a negative indent amount if we're
   			// indenting
  -			if (m_indentResult && (indentAmount < 0))
  +			if (m_indentResult && indentAmount < 0)
   				indentAmount = 0;
   			
   			switch(m_outputmethod)
  
  
  
  1.6       +1 -1      xml-xalan/c/src/XSLT/XSLTResultTarget.hpp
  
  Index: XSLTResultTarget.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTResultTarget.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XSLTResultTarget.hpp	2000/04/25 19:54:20	1.5
  +++ XSLTResultTarget.hpp	2000/05/05 15:14:26	1.6
  @@ -259,7 +259,7 @@
   	 *
   	 * @return pointer to current handler
   	 */
  -	DocumentHandler*
  +	FormatterListener*
   	getDocumentHandler() const
   	{
   		return m_formatterListener;