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/09/27 18:46:46 UTC

cvs commit: xml-xalan/c/samples/UseStylesheetParam UseStylesheetParam.cpp

dbertoni    00/09/27 09:46:45

  Modified:    c/samples/CompileStylesheet CompileStylesheet.cpp
               c/samples/ExternalFunction ExternalFunction.cpp
               c/samples/SimpleTransform SimpleTransform.cpp
               c/samples/ThreadSafe ThreadSafe.cpp
               c/samples/TraceListen TraceListen.cpp
               c/samples/UseStylesheetParam UseStylesheetParam.cpp
  Log:
  Output transcoding support.
  
  Revision  Changes    Path
  1.13      +6 -11     xml-xalan/c/samples/CompileStylesheet/CompileStylesheet.cpp
  
  Index: CompileStylesheet.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/samples/CompileStylesheet/CompileStylesheet.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- CompileStylesheet.cpp	2000/09/20 18:24:42	1.12
  +++ CompileStylesheet.cpp	2000/09/27 16:46:37	1.13
  @@ -15,7 +15,6 @@
   
   
   #include <PlatformSupport/DOMStringHelper.hpp>
  -#include <DOMSupport/DOMSupportDefault.hpp>
   
   
   
  @@ -36,15 +35,11 @@
   
   
   
  +#include <XercesParserLiaison/XercesDOMSupport.hpp>
   #include <XercesParserLiaison/XercesParserLiaison.hpp>
   
   
   
  -#include <XercesPlatformSupport/TextFileOutputStream.hpp>
  -#include <XercesPlatformSupport/XercesDOMPrintWriter.hpp>
  -
  -
  -
   int
   main(
   			int				argc,
  @@ -75,7 +70,7 @@
   				XSLTInit						theInit;
   
   				// Create the support objects that are necessary for running the processor...
  -				DOMSupportDefault				theDOMSupport;
  +				XercesDOMSupport				theDOMSupport;
   				XercesParserLiaison				theParserLiaison(theDOMSupport);
   				XPathSupportDefault				theXPathSupport(theDOMSupport);
   				XSLTProcessorEnvSupportDefault	theXSLTProcessorEnvSupport;
  @@ -87,6 +82,7 @@
   						theParserLiaison,
   						theXPathSupport,
   						theXSLTProcessorEnvSupport,
  +						theDOMSupport,
   						theXObjectFactory,
   						theXPathFactory);
   
  @@ -114,11 +110,10 @@
   							theXPathSupport,
   							theXObjectFactory);
   
  -				// Our input files.  The assumption is that the executable will be run
  +				// Our input file.  The assumption is that the executable will be run
   				// from same directory as the input files.
  -				const XalanDOMString		theXMLFileName("foo.xml");
  -				const XalanDOMString		theXSLFileName("foo.xsl");
  -				
  +				const XalanDOMString	theXSLFileName("foo.xsl");
  +
   				// Our stylesheet input source...
   				XSLTInputSource			theStylesheetSource(c_wstr(theXSLFileName));
   
  
  
  
  1.9       +5 -9      xml-xalan/c/samples/ExternalFunction/ExternalFunction.cpp
  
  Index: ExternalFunction.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/samples/ExternalFunction/ExternalFunction.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ExternalFunction.cpp	2000/08/31 19:33:13	1.8
  +++ ExternalFunction.cpp	2000/09/27 16:46:39	1.9
  @@ -39,15 +39,11 @@
   
   
   
  +#include <XercesParserLiaison/XercesDOMSupport.hpp>
   #include <XercesParserLiaison/XercesParserLiaison.hpp>
   
   
   
  -#include <XercesPlatformSupport/TextFileOutputStream.hpp>
  -#include <XercesPlatformSupport/XercesDOMPrintWriter.hpp>
  -
  -
  -
   // This class defines a function that will return the square root
   // of its argument.
   class FunctionSquareRoot : public Function
  @@ -265,7 +261,7 @@
   				XSLTInit						theInit;
   
   				// Create the support objects that are necessary for running the processor...
  -				DOMSupportDefault				theDOMSupport;
  +				XercesDOMSupport				theDOMSupport;
   				XercesParserLiaison				theParserLiaison(theDOMSupport);
   				XPathSupportDefault				theXPathSupport(theDOMSupport);
   				XSLTProcessorEnvSupportDefault	theXSLTProcessorEnvSupport;
  @@ -277,6 +273,7 @@
   						theParserLiaison,
   						theXPathSupport,
   						theXSLTProcessorEnvSupport,
  +						theDOMSupport,
   						theXObjectFactory,
   						theXPathFactory);
   
  @@ -307,9 +304,8 @@
   				XSLTInputSource		theStylesheetSource(c_wstr(theXSLFileName));
   
   				// Our output target...
  -				TextFileOutputStream	theOutputStream("foo.out");
  -				XercesDOMPrintWriter	theResultWriter(theOutputStream);
  -				XSLTResultTarget		theResultTarget(&theResultWriter);
  +				const XalanDOMString	theOutputFile("foo.out");
  +				XSLTResultTarget		theResultTarget(theOutputFile);
   
   				// Install the function directly into the XPath
   				// function table.  We don't recommend doing this,
  
  
  
  1.10      +5 -9      xml-xalan/c/samples/SimpleTransform/SimpleTransform.cpp
  
  Index: SimpleTransform.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/samples/SimpleTransform/SimpleTransform.cpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SimpleTransform.cpp	2000/08/31 19:33:13	1.9
  +++ SimpleTransform.cpp	2000/09/27 16:46:41	1.10
  @@ -36,15 +36,11 @@
   
   
   
  +#include <XercesParserLiaison/XercesDOMSupport.hpp>
   #include <XercesParserLiaison/XercesParserLiaison.hpp>
   
   
   
  -#include <XercesPlatformSupport/TextFileOutputStream.hpp>
  -#include <XercesPlatformSupport/XercesDOMPrintWriter.hpp>
  -
  -
  -
   int
   main(
   			int				argc,
  @@ -74,7 +70,7 @@
   				XSLTInit						theInit;
   
   				// Create the support objects that are necessary for running the processor...
  -				DOMSupportDefault				theDOMSupport;
  +				XercesDOMSupport				theDOMSupport;
   				XercesParserLiaison				theParserLiaison(theDOMSupport);
   				XPathSupportDefault				theXPathSupport(theDOMSupport);
   				XSLTProcessorEnvSupportDefault	theXSLTProcessorEnvSupport;
  @@ -86,6 +82,7 @@
   						theParserLiaison,
   						theXPathSupport,
   						theXSLTProcessorEnvSupport,
  +						theDOMSupport,
   						theXObjectFactory,
   						theXPathFactory);
   
  @@ -115,9 +112,8 @@
   				XSLTInputSource		theStylesheetSource(c_wstr(theXSLFileName));
   
   				// Our output target...
  -				TextFileOutputStream	theOutputStream("foo.out");
  -				XercesDOMPrintWriter	theResultWriter(theOutputStream);
  -				XSLTResultTarget		theResultTarget(&theResultWriter);
  +				const XalanDOMString	theOutputFileName("foo.out");
  +				XSLTResultTarget		theResultTarget(theOutputFileName);
   
   				theProcessor.process(
   							theInputSource,
  
  
  
  1.8       +8 -4      xml-xalan/c/samples/ThreadSafe/ThreadSafe.cpp
  
  Index: ThreadSafe.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/samples/ThreadSafe/ThreadSafe.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ThreadSafe.cpp	2000/08/31 19:33:14	1.7
  +++ ThreadSafe.cpp	2000/09/27 16:46:42	1.8
  @@ -21,10 +21,12 @@
   #include <XSLT/XSLTProcessorEnvSupportDefault.hpp>
   #include <XSLT/XSLTResultTarget.hpp>
   
  +
  +
  +#include <XercesParserLiaison/XercesDOMSupport.hpp>
   #include <XercesParserLiaison/XercesParserLiaison.hpp>
  +
   
  -#include <XercesPlatformSupport/TextFileOutputStream.hpp>
  -#include <XercesPlatformSupport/XercesDOMPrintWriter.hpp>
   
   //This is here for the Windows threads.
   #define WIN32_LEAN_AND_MEAN
  @@ -68,7 +70,7 @@
   	const DWORD		theThreadID = GetCurrentThreadId();
   
   	// Create the support objects that are necessary for running the processor...
  -	DOMSupportDefault				theDOMSupport;
  +	XercesDOMSupport				theDOMSupport;
   	XercesParserLiaison				theParserLiaison(theDOMSupport);
   	XPathSupportDefault				theXPathSupport(theDOMSupport);
   	XSLTProcessorEnvSupportDefault	theXSLTProcessorEnvSupport;
  @@ -80,6 +82,7 @@
   					theParserLiaison,
   					theXPathSupport,
   					theXSLTProcessorEnvSupport,
  +					theDOMSupport,
   					theXObjectFactory,
   					theXPathFactory);
   	outputMessage(theThreadID,"Starting ");
  @@ -191,7 +194,7 @@
   				XSLTInit						theInit;
   
   				// Create the support objects required to run the processor...
  -				DOMSupportDefault				ssDOMSupport;
  +				XercesDOMSupport				ssDOMSupport;
   				XercesParserLiaison				ssParserLiaison(ssDOMSupport);
   				XPathSupportDefault				ssXPathSupport(ssDOMSupport);
   				XSLTProcessorEnvSupportDefault	ssXSLTProcessorEnvSupport;
  @@ -206,6 +209,7 @@
   						ssParserLiaison,
   						ssXPathSupport,
   						ssXSLTProcessorEnvSupport,
  +						ssDOMSupport,
   						ssXObjectFactory,
   						ssXPathFactory);
   
  
  
  
  1.6       +22 -9     xml-xalan/c/samples/TraceListen/TraceListen.cpp
  
  Index: TraceListen.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/samples/TraceListen/TraceListen.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TraceListen.cpp	2000/08/31 19:33:14	1.5
  +++ TraceListen.cpp	2000/09/27 16:46:43	1.6
  @@ -1,26 +1,39 @@
   // Base header file.  Must be first.
   #include <Include/PlatformDefinitions.hpp>
   
  +
  +
   #include <iostream>
   #include <fstream>
   
  +
  +
   #include <util/PlatformUtils.hpp>
   
  +
  +
   #include <PlatformSupport/DOMStringHelper.hpp>
  +#include <PlatformSupport/XalanOutputStreamPrintWriter.hpp>
  +#include <PlatformSupport/XalanStdOutputStream.hpp>
  +
   
  +
   #include <DOMSupport/DOMSupportDefault.hpp>
   
  +
  +
   #include <XPath/XObjectFactoryDefault.hpp>
   #include <XPath/XPathSupportDefault.hpp>
   #include <XPath/XPathFactoryDefault.hpp>
   #include <XPath/XPathProcessorImpl.hpp>
   
  -#include <XercesPlatformSupport/XercesDOMPrintWriter.hpp>
  -#include <XercesPlatformSupport/TextFileOutputStream.hpp>
  -#include <XercesPlatformSupport/XercesStdTextOutputStream.hpp>
   
  +
  +#include <XercesParserLiaison/XercesDOMSupport.hpp>
   #include <XercesParserLiaison/XercesParserLiaison.hpp>
   
  +
  +
   #include <XSLT/XSLTEngineImpl.hpp>
   #include <XSLT/XSLTInit.hpp>
   #include <XSLT/XSLTInputSource.hpp>
  @@ -91,7 +104,7 @@
   			XSLTInit						theInit;
   
   			// Create the support objects that are necessary for running the processor...
  -			DOMSupportDefault				theDOMSupport;
  +			XercesDOMSupport				theDOMSupport;
   			XercesParserLiaison				theParserLiaison(theDOMSupport);
   			XPathSupportDefault				theXPathSupport(theDOMSupport);
   			XSLTProcessorEnvSupportDefault	theXSLTProcessorEnvSupport;
  @@ -103,6 +116,7 @@
   						theParserLiaison,
   						theXPathSupport,
   						theXSLTProcessorEnvSupport,
  +						theDOMSupport,
   						theXObjectFactory,
   						theXPathFactory);
   
  @@ -132,13 +146,12 @@
   			XSLTInputSource		theStylesheetSource(c_wstr(theXSLFileName));
   
   			// Our output target...
  -			TextFileOutputStream	theOutputStream("birds.out");
  -			XercesDOMPrintWriter	theResultWriter(theOutputStream);
  -			XSLTResultTarget		theResultTarget(&theResultWriter);
  +			const XalanDOMString	theOutputFile("birds.out");
  +			XSLTResultTarget		theResultTarget(theOutputFile);
   
   			// Set up a diagnostic writer to be used by the TraceListener...
  -			XercesStdTextOutputStream				theStdErr(cerr);
  -			XercesDOMPrintWriter					diagnosticsWriter(theStdErr);
  +			XalanStdOutputStream			theStdErr(cerr);
  +			XalanOutputStreamPrintWriter	diagnosticsWriter(theStdErr);
   
   			// Set up the TraceListener... 
   			TraceListenerDefault		theTraceListener(				
  
  
  
  1.8       +11 -12    xml-xalan/c/samples/UseStylesheetParam/UseStylesheetParam.cpp
  
  Index: UseStylesheetParam.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/samples/UseStylesheetParam/UseStylesheetParam.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- UseStylesheetParam.cpp	2000/08/31 19:33:15	1.7
  +++ UseStylesheetParam.cpp	2000/09/27 16:46:44	1.8
  @@ -24,10 +24,9 @@
   #include <XSLT/XSLTProcessorEnvSupportDefault.hpp>
   #include <XSLT/XSLTResultTarget.hpp>
   
  +#include <XercesParserLiaison/XercesDOMSupport.hpp>
   #include <XercesParserLiaison/XercesParserLiaison.hpp>
   
  -#include <XercesPlatformSupport/TextFileOutputStream.hpp>
  -#include <XercesPlatformSupport/XercesDOMPrintWriter.hpp>
   
   int
   main(
  @@ -58,24 +57,23 @@
   
   			// Get the stylesheet parameter key (name) and
   			// expression (a string expression).
  -			const DOMString		paramKey(argv[1]);
  -			const DOMString		paramExpression(argv[2]);
  +			const XalanDOMString	paramKey(argv[1]);
  +			const XalanDOMString	paramExpression(argv[2]);
   
   			// Set up input and output objects for the transformation.
   			// Assumption: the executable is run from the directory
   			// containing the input files. 
  -			const DOMString		theXMLFileName("foo.xml");
  -			const DOMString		theXSLFileName("foo.xsl");
  -			XSLTInputSource		theInputSource(c_wstr(theXMLFileName));
  -			XSLTInputSource		theStylesheetSource(c_wstr(theXSLFileName));
  +			const XalanDOMString	theXMLFileName("foo.xml");
  +			const XalanDOMString	theXSLFileName("foo.xsl");
  +			XSLTInputSource			theInputSource(c_wstr(theXMLFileName));
  +			XSLTInputSource			theStylesheetSource(c_wstr(theXSLFileName));
    
   			// The output target...
  -			TextFileOutputStream	theOutputStream("foo.out");
  -			XercesDOMPrintWriter	theResultWriter(theOutputStream);
  -			XSLTResultTarget		theResultTarget(&theResultWriter);
  +			const XalanDOMString	theOutputFile("foo.out");
  +			XSLTResultTarget		theResultTarget(theOutputFile);
   
   			// Create the support objects that are necessary for running the processor...
  -			DOMSupportDefault				theDOMSupport;
  +			XercesDOMSupport				theDOMSupport;
   			XercesParserLiaison				theParserLiaison(theDOMSupport);
   			XPathSupportDefault				theXPathSupport(theDOMSupport);
   			XSLTProcessorEnvSupportDefault	theXSLTProcessorEnvSupport;
  @@ -87,6 +85,7 @@
   						theParserLiaison,
   						theXPathSupport,
   						theXSLTProcessorEnvSupport,
  +						theDOMSupport,
   						theXObjectFactory,
   						theXPathFactory);