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/06/07 00:08:24 UTC

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

dbertoni    01/06/06 15:08:24

  Modified:    c/samples/ExternalFunction ExternalFunction.cpp
  Log:
  Simplified sample.
  
  Revision  Changes    Path
  1.17      +4 -17     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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ExternalFunction.cpp	2001/04/30 21:26:11	1.16
  +++ ExternalFunction.cpp	2001/06/06 22:08:23	1.17
  @@ -168,6 +168,7 @@
   		time(&theTime);
   
   		char* const	theTimeString = asctime(localtime(&theTime));
  +		assert(theTimeString != 0);
   
   		// The resulting string has a newline character at the end,
   		// so get rid of it.
  @@ -238,43 +239,29 @@
   		// Create a XalanTransformer.
   		XalanTransformer theXalanTransformer;
   
  -		// Our input files...The assumption is that the executable will be run
  -		// from same directory as the input files.
  -		const char*		theXMLFileName = "foo.xml";
  -		const char*		theXSLFileName = "foo.xsl";
  -
  -		// Our output target...
  -		const char*	theOutputFileName = "foo.out";
  -
   		// The namespace for our functions...
   		const XalanDOMString	theNamespace("http://ExternalFunction.xalan-c++.xml.apache.org");
   
  -		// Install the function in the local space.  It will only
  +		// Install the functions in the local space.  They will only
   		// be installed in this instance, so no other instances
  -		// will know about the function...
  +		// will know about them...
   		theXalanTransformer.installExternalFunction(
   			theNamespace,
   			XalanDOMString("asctime"),
   			FunctionAsctime());
   
  -		// Install the function in the local space.  It will only
  -		// be installed in this instance, so no other instances
  -		// will know about the function...
   		theXalanTransformer.installExternalFunction(
   			theNamespace,
   			XalanDOMString("square-root"),
   			FunctionSquareRoot());
   
  -		// Install the function in the local space.  It will only
  -		// be installed in this instance, so no other instances
  -		// will know about the function...
   		theXalanTransformer.installExternalFunction(
   			theNamespace,
   			XalanDOMString("cube"),
   			FunctionCube());
   
   		// Do the transform.
  -		theResult = theXalanTransformer.transform(theXMLFileName, theXSLFileName, theOutputFileName);
  +		theResult = theXalanTransformer.transform("foo.xml", "foo.xsl", "foo.out");
       
   		if(theResult != 0)
   		{
  
  
  

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