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/08/20 17:20:03 UTC

cvs commit: xml-xalan/c/src/XalanTransformer XalanTransformer.cpp

dbertoni    01/08/20 08:20:03

  Modified:    c/src/XalanTransformer XalanTransformer.cpp
  Log:
  Added ICU support to XalanTransformer.
  
  Revision  Changes    Path
  1.28      +31 -0     xml-xalan/c/src/XalanTransformer/XalanTransformer.cpp
  
  Index: XalanTransformer.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanTransformer/XalanTransformer.cpp,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- XalanTransformer.cpp	2001/08/16 14:44:58	1.27
  +++ XalanTransformer.cpp	2001/08/20 15:20:03	1.28
  @@ -96,6 +96,15 @@
   
   
   
  +//#define XALAN_USE_ICU
  +#if defined(XALAN_USE_ICU)
  +#include <ICUBridge/ICUBridge.hpp>
  +#include <ICUBridge/FunctionICUFormatNumber.hpp>
  +#include <ICUBridge/ICUBridgeCollationCompareFunctor.hpp>
  +#endif
  +
  +
  +
   #include "XalanCompiledStylesheetDefault.hpp"
   #include "XalanDefaultDocumentBuilder.hpp"
   #include "XalanDefaultParsedSource.hpp"
  @@ -106,6 +115,10 @@
   
   XSLTInit*	XalanTransformer::s_xsltInit = 0;
   
  +#if defined(XALAN_USE_ICU)
  +static const ICUBridgeCollationCompareFunctor*	theICUFunctor = 0;
  +#endif
  +
   
   
   XalanTransformer::XalanTransformer():
  @@ -116,6 +129,9 @@
   	m_errorMessage(1, '\0'),
   	m_stylesheetExecutionContext(new StylesheetExecutionContextDefault)
   {
  +#if defined(XALAN_USE_ICU)
  +	m_stylesheetExecutionContext->installCollationCompareFunctor(theICUFunctor);
  +#endif
   }
   
   
  @@ -153,6 +169,15 @@
   {
   	// Initialize Xalan. 
   	s_xsltInit = new XSLTInit;
  +
  +#if defined(XALAN_USE_ICU)
  +	theICUFunctor = new ICUBridgeCollationCompareFunctor;
  +
  +	// Install the ICU version of format-number...
  +	XPath::installFunction(
  +			StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("format-number")),
  +			FunctionICUFormatNumber());
  +#endif
   }
   
   
  @@ -164,6 +189,12 @@
   	delete s_xsltInit;
   
   	s_xsltInit = 0;
  +
  +#if defined(XALAN_USE_ICU)
  +	delete theICUFunctor;
  +
  +	theICUFunctor = 0;
  +#endif
   }
   
   
  
  
  

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