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/02/08 22:15:15 UTC

cvs commit: xml-xalan/c/src/XMLSupport FormatterListener.cpp FormatterListener.hpp FormatterToDOM.cpp FormatterToDOM.hpp FormatterToHTML.cpp FormatterToXML.cpp FormatterToXML.hpp XMLSupportInit.cpp

dbertoni    01/02/08 13:15:13

  Modified:    c/src/XMLSupport FormatterListener.cpp FormatterListener.hpp
                        FormatterToDOM.cpp FormatterToDOM.hpp
                        FormatterToHTML.cpp FormatterToXML.cpp
                        FormatterToXML.hpp XMLSupportInit.cpp
  Log:
  Moved raw formatting PI strings into FormatterListener.
  
  Revision  Changes    Path
  1.3       +52 -16    xml-xalan/c/src/XMLSupport/FormatterListener.cpp
  
  Index: FormatterListener.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterListener.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FormatterListener.cpp	2000/05/18 18:37:23	1.2
  +++ FormatterListener.cpp	2001/02/08 21:14:38	1.3
  @@ -10,33 +10,33 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *	  notice, this list of conditions and the following disclaimer. 
    *
    * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  + *	  notice, this list of conditions and the following disclaimer in
  + *	  the documentation and/or other materials provided with the
  + *	  distribution.
    *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  - *       "This product includes software developed by the
  - *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software itself,
  - *    if and wherever such third-party acknowledgments normally appear.
  + *	  if any, must include the following acknowledgment:  
  + *		 "This product includes software developed by the
  + *		  Apache Software Foundation (http://www.apache.org/)."
  + *	  Alternately, this acknowledgment may appear in the software itself,
  + *	  if and wherever such third-party acknowledgments normally appear.
    *
    * 4. The names "Xalan" and "Apache Software Foundation" must
  - *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  - *    permission, please contact apache@apache.org.
  + *	  not be used to endorse or promote products derived from this
  + *	  software without prior written permission. For written 
  + *	  permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  - *    nor may "Apache" appear in their name, without prior written
  - *    permission of the Apache Software Foundation.
  + *	  nor may "Apache" appear in their name, without prior written
  + *	  permission of the Apache Software Foundation.
    *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * DISCLAIMED.	IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  @@ -55,7 +55,7 @@
    * <http://www.apache.org/>.
    */
   /**
  - * $Id: FormatterListener.cpp,v 1.2 2000/05/18 18:37:23 dbertoni Exp $
  + * $Id: FormatterListener.cpp,v 1.3 2001/02/08 21:14:38 dbertoni Exp $
    * 
    * $State: Exp $
    * 
  @@ -69,6 +69,10 @@
   
   
   
  +#include <PlatformSupport/DOMStringHelper.hpp>
  +
  +
  +
   FormatterListener::FormatterListener(eFormat	theFormat) :
   	DocumentHandler(),
   	m_outputFormat(theFormat)
  @@ -79,4 +83,36 @@
   
   FormatterListener::~FormatterListener()
   {
  +}
  +
  +
  +
  +static XalanDOMString	s_xsltNextIsRawString;
  +
  +static XalanDOMString	s_formatterListenerString;
  +
  +
  +
  +const XalanDOMString&	FormatterListener::s_xsltNextIsRawString = ::s_xsltNextIsRawString;
  +
  +const XalanDOMString&	FormatterListener::s_formatterListenerString = ::s_formatterListenerString;
  +
  +
  +
  +void
  +FormatterListener::initialize()
  +{
  +	::s_xsltNextIsRawString = XALAN_STATIC_UCODE_STRING("raw");
  +
  +	::s_formatterListenerString = XALAN_STATIC_UCODE_STRING("formatter-listener");
  +}
  +
  +
  +
  +void
  +FormatterListener::terminate()
  +{
  +	releaseMemory(::s_xsltNextIsRawString);
  +
  +	releaseMemory(::s_formatterListenerString);
   }
  
  
  
  1.8       +25 -1     xml-xalan/c/src/XMLSupport/FormatterListener.hpp
  
  Index: FormatterListener.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterListener.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FormatterListener.hpp	2000/05/18 18:37:23	1.7
  +++ FormatterListener.hpp	2001/02/08 21:14:42	1.8
  @@ -58,7 +58,7 @@
   #define FORMATTERLISTENER_HEADER_GUARD_1357924680
   
   /**
  - * $Id: FormatterListener.hpp,v 1.7 2000/05/18 18:37:23 dbertoni Exp $
  + * $Id: FormatterListener.hpp,v 1.8 2001/02/08 21:14:42 dbertoni Exp $
    * 
    * $State: Exp $
    * 
  @@ -76,6 +76,10 @@
   
   
   
  +#include <XalanDOM/XalanDOMString.hpp>
  +
  +
  +
   /**
    * A SAX-based formatter interface for the XSL processor.  This interface 
    * will be called as result tree elements are constructed.
  @@ -84,6 +88,19 @@
   {
   public:
   
  +	/**
  +	 * Perform static initialization.  See class XMLSupportInit.
  +	 */
  +	static void
  +	initialize();
  +
  +	/**
  +	 * Perform static shut down.  See class XMLSupportInit.
  +	 */
  +	static void
  +	terminate();
  +
  +
   	enum eFormat
   	{
   		OUTPUT_METHOD_NONE = 0,
  @@ -201,6 +218,13 @@
   	startElement(
   			const	XMLCh* const	name,
   			AttributeList&			attrs) = 0;
  +
  +
  +	// Used when creating PI to work around limitations of
  +	// our interfaces...
  +	static const XalanDOMString&	s_xsltNextIsRawString;
  +
  +	static const XalanDOMString&	s_formatterListenerString;
   
   private:
   
  
  
  
  1.13      +1 -33     xml-xalan/c/src/XMLSupport/FormatterToDOM.cpp
  
  Index: FormatterToDOM.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToDOM.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- FormatterToDOM.cpp	2001/01/16 02:47:48	1.12
  +++ FormatterToDOM.cpp	2001/02/08 21:14:44	1.13
  @@ -202,7 +202,7 @@
   {
   	append(m_doc->createProcessingInstruction(
   				s_xsltNextIsRawString,
  -				s_formatterToDOMString));
  +				s_formatterListenerString));
   
   	characters(chars, length);
   }		
  @@ -283,36 +283,4 @@
   	{
   		m_doc->appendChild(newNode);
   	}
  -}
  -
  -
  -
  -static XalanDOMString	s_xsltNextIsRawString;
  -
  -static XalanDOMString	s_formatterToDOMString;
  -
  -
  -
  -const XalanDOMString&	FormatterToDOM::s_xsltNextIsRawString = ::s_xsltNextIsRawString;
  -
  -const XalanDOMString&	FormatterToDOM::s_formatterToDOMString = ::s_formatterToDOMString;
  -
  -
  -
  -void
  -FormatterToDOM::initialize()
  -{
  -	::s_xsltNextIsRawString = XALAN_STATIC_UCODE_STRING("xslt-next-is-raw");
  -
  -	::s_formatterToDOMString = XALAN_STATIC_UCODE_STRING("formatter-to-dom");
  -}
  -
  -
  -
  -void
  -FormatterToDOM::terminate()
  -{
  -	clear(::s_xsltNextIsRawString);
  -
  -	clear(::s_formatterToDOMString);
   }
  
  
  
  1.12      +0 -17     xml-xalan/c/src/XMLSupport/FormatterToDOM.hpp
  
  Index: FormatterToDOM.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToDOM.hpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- FormatterToDOM.hpp	2001/01/16 02:47:48	1.11
  +++ FormatterToDOM.hpp	2001/02/08 21:14:46	1.12
  @@ -93,19 +93,6 @@
   public:
   
   	/**
  -	 * Perform static initialization.  See class XMLSupportInit.
  -	 */
  -	static void
  -	initialize();
  -
  -	/**
  -	 * Perform static shut down.  See class XMLSupportInit.
  -	 */
  -	static void
  -	terminate();
  -
  -
  -	/**
   	 * Construct a FormatterToDOM instance.  it will add the DOM nodes 
   	 * to the document fragment.
   	 *
  @@ -247,10 +234,6 @@
   	ElementStackType				m_elemStack;
   
   	XalanDOMString					m_buffer;
  -
  -	static const XalanDOMString&	s_xsltNextIsRawString;
  -
  -	static const XalanDOMString&	s_formatterToDOMString;
   };
   
   
  
  
  
  1.48      +1 -1      xml-xalan/c/src/XMLSupport/FormatterToHTML.cpp
  
  Index: FormatterToHTML.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToHTML.cpp,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- FormatterToHTML.cpp	2001/01/31 01:39:58	1.47
  +++ FormatterToHTML.cpp	2001/02/08 21:14:48	1.48
  @@ -573,7 +573,7 @@
   	// Use a fairly nasty hack to tell if the next node is supposed to be 
   	// unescaped text.
   	if(equals(target, s_xsltNextIsRawString) == true &&
  -	   equals(data, s_formatterToDOMString) == true)
  +	   equals(data, s_formatterListenerString) == true)
   	{
   		m_nextIsRaw = true;
   	}
  
  
  
  1.44      +1 -17     xml-xalan/c/src/XMLSupport/FormatterToXML.cpp
  
  Index: FormatterToXML.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToXML.cpp,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- FormatterToXML.cpp	2001/01/25 17:01:40	1.43
  +++ FormatterToXML.cpp	2001/02/08 21:14:50	1.44
  @@ -805,7 +805,7 @@
   		// Use a fairly nasty hack to tell if the next node is supposed to be 
   		// unescaped text.
   		if(equals(target, c_wstr(s_xsltNextIsRawString)) == true
  -			&& equals(data, c_wstr(s_formatterToDOMString)) == true)
  +			&& equals(data, c_wstr(s_formatterListenerString)) == true)
   		{
   			m_nextIsRaw = true;
   		}
  @@ -1364,10 +1364,6 @@
   
   
   
  -static XalanDOMString	s_xsltNextIsRawString;
  -
  -static XalanDOMString	s_formatterToDOMString;
  -
   static XalanDOMString	s_defaultMIMEEncoding;
   
   static XalanDOMString	s_doctypeHeaderStartString;
  @@ -1393,10 +1389,6 @@
   static XalanDOMString	s_dtdCDATACloseString;
   
   
  -const XalanDOMString&	FormatterToXML::s_xsltNextIsRawString = ::s_xsltNextIsRawString;
  -
  -const XalanDOMString&	FormatterToXML::s_formatterToDOMString = ::s_formatterToDOMString;
  -
   const XalanDOMString&	FormatterToXML::s_defaultMIMEEncoding = ::s_defaultMIMEEncoding;
   
   const XalanDOMString&	FormatterToXML::s_doctypeHeaderStartString = ::s_doctypeHeaderStartString;
  @@ -1430,10 +1422,6 @@
   void
   FormatterToXML::initialize()
   {
  -	::s_xsltNextIsRawString = XALAN_STATIC_UCODE_STRING("xslt-next-is-raw");
  -
  -	::s_formatterToDOMString = XALAN_STATIC_UCODE_STRING("formatter-to-dom");
  -
   	::s_defaultMIMEEncoding = XALAN_STATIC_UCODE_STRING("UTF-8");
   
   	::s_doctypeHeaderStartString = XALAN_STATIC_UCODE_STRING("<!DOCTYPE ");
  @@ -1464,10 +1452,6 @@
   void
   FormatterToXML::terminate()
   {
  -	clear(::s_xsltNextIsRawString);
  -
  -	clear(::s_formatterToDOMString);
  -
   	clear(::s_defaultMIMEEncoding);
   
   	clear(::s_doctypeHeaderStartString);
  
  
  
  1.30      +0 -10     xml-xalan/c/src/XMLSupport/FormatterToXML.hpp
  
  Index: FormatterToXML.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToXML.hpp,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- FormatterToXML.hpp	2001/01/09 16:00:29	1.29
  +++ FormatterToXML.hpp	2001/02/08 21:14:53	1.30
  @@ -652,16 +652,6 @@
   	int		m_indent;
   
   	/**
  -	 * The text "xslt-next-is-raw".
  -	 */
  -	static const XalanDOMString&	s_xsltNextIsRawString;
  -
  -	/**
  -	 * The string "formatter-to-dom".
  -	 */
  -	static const XalanDOMString&	s_formatterToDOMString;
  -
  -	/**
   	 * Stack to keep track of whether or not we need to 
   	 * preserve whitespace.
   	 */
  
  
  
  1.3       +3 -3      xml-xalan/c/src/XMLSupport/XMLSupportInit.cpp
  
  Index: XMLSupportInit.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/XMLSupportInit.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLSupportInit.cpp	2000/09/05 02:24:49	1.2
  +++ XMLSupportInit.cpp	2001/02/08 21:14:55	1.3
  @@ -59,7 +59,7 @@
   
   
   
  -#include "FormatterToDOM.hpp"
  +#include "FormatterListener.hpp"
   #include "FormatterToHTML.hpp"
   #include "FormatterToXML.hpp"
   
  @@ -98,7 +98,7 @@
   void
   XMLSupportInit::initialize()
   {
  -	FormatterToDOM::initialize();
  +	FormatterListener::initialize();
   
   	FormatterToXML::initialize();
   
  @@ -114,5 +114,5 @@
   
   	FormatterToXML::terminate();
   
  -	FormatterToDOM::terminate();
  +	FormatterListener::terminate();
   }