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/04/21 22:58:36 UTC

cvs commit: xml-xalan/c/samples/SimpleTransform foo.xml foo.xsl SimpleTransform.cpp SimpleTransform.dsp SimpleTransform.dsw

dbertoni    00/04/21 13:58:36

  Added:       c/samples/SimpleTransform foo.xml foo.xsl
                        SimpleTransform.cpp SimpleTransform.dsp
                        SimpleTransform.dsw
  Log:
  Initial revision.
  
  Revision  Changes    Path
  1.1                  xml-xalan/c/samples/SimpleTransform/foo.xml
  
  Index: foo.xml
  ===================================================================
  <?xml version="1.0"?>
  <doc>Hello</doc>
  
  
  
  1.1                  xml-xalan/c/samples/SimpleTransform/foo.xsl
  
  Index: foo.xsl
  ===================================================================
  <?xml version="1.0"?> 
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="doc">
      <out><xsl:value-of select="."/></out>
    </xsl:template>
  </xsl:stylesheet>
  
  
  
  1.1                  xml-xalan/c/samples/SimpleTransform/SimpleTransform.cpp
  
  Index: SimpleTransform.cpp
  ===================================================================
  #include <iostream>
  #include <fstream>
  
  
  
  #include <util/PlatformUtils.hpp>
  
  
  
  #include <PlatformSupport/DOMStringHelper.hpp>
  
  
  
  #include <DOMSupport/DOMSupportDefault.hpp>
  
  
  
  #include <XPath/XObjectFactoryDefault.hpp>
  #include <XPath/XPathSupportDefault.hpp>
  #include <XPath/XPathFactoryDefault.hpp>
  
  
  
  #include <XSLT/StylesheetConstructionContextDefault.hpp>
  #include <XSLT/StylesheetExecutionContextDefault.hpp>
  #include <XSLT/XSLTEngineImpl.hpp>
  #include <XSLT/XSLTInputSource.hpp>
  #include <XSLT/XSLTProcessorEnvSupportDefault.hpp>
  #include <XSLT/XSLTResultTarget.hpp>
  
  
  
  #include <XercesParserLiaison/XercesParserLiaison.hpp>
  
  
  
  #include <XercesPlatformSupport/TextFileOutputStream.hpp>
  #include <XercesPlatformSupport/XercesDOMPrintWriter.hpp>
  
  
  
  int
  main(
  			int				argc,
  			const char*		/* argv */[])
  {
  #if !defined(XALAN_NO_NAMESPACES)
  	using std::cerr;
  	using std::endl;
  	using std::ofstream;
  #endif
  
  	if (argc != 1)
  	{
  		cerr << "Usage: SimpleTransform"
  			 << endl
  			 << endl;
  	}
  	else
  	{
  		try
  		{
  			// Call the static initializers...
  			XMLPlatformUtils::Initialize();
  			XSLTEngineImpl::Initialize();
  
  			// Create the support objects that are necessary for running the processor...
  			DOMSupportDefault				theDOMSupport;
  			XercesParserLiaison				theParserLiaison(theDOMSupport);
  			XPathSupportDefault				theXPathSupport(theDOMSupport);
  			XSLTProcessorEnvSupportDefault	theXSLTProcessorEnvSupport;
  			XObjectFactoryDefault			theXObjectFactory(theXSLTProcessorEnvSupport, theXPathSupport);
  			XPathFactoryDefault				theXPathFactory;
  
  			// Create a processor...
  			XSLTEngineImpl	theProcessor(
  					theParserLiaison,
  					theXPathSupport,
  					theXSLTProcessorEnvSupport,
  					theXObjectFactory,
  					theXPathFactory);
  
  			// Connect the processor to the support object...
  			theXSLTProcessorEnvSupport.setProcessor(&theProcessor);
  
  			// Use the parser liaison as the formatter...
  			theProcessor.setFormatter(&theParserLiaison);
  
  			// Create a stylesheet construction context, and a stylesheet
  			// execution context...
  			StylesheetConstructionContextDefault	theConstructionContext(
  						theProcessor,
  						theXSLTProcessorEnvSupport,
  						theXObjectFactory,
  						theXPathFactory);
  
  			StylesheetExecutionContextDefault		theExecutionContext(
  						theProcessor,
  						theXSLTProcessorEnvSupport,
  						theXPathSupport,
  						theXObjectFactory);
  
  			// Our input files...
  			// WARNING!!! You may need to modify these absolute paths depending on where
  			// you've put the Xalan sources.
  			const DOMString		theXMLFileName("file:///xml-xalan/c/Samples/SimpleTransform/foo.xml");
  			const DOMString		theXSLFileName("file:///xml-xalan/c/Samples/SimpleTransform/foo.xsl");
  
  			// Our input sources...
  			XSLTInputSource		theInputSource(c_wstr(theXMLFileName));
  			XSLTInputSource		theStylesheetSource(c_wstr(theXSLFileName));
  
  			// Our output target...
  			TextFileOutputStream	theOutputStream("foo.out");
  			XercesDOMPrintWriter	theResultWriter(theOutputStream);
  			XSLTResultTarget		theResultTarget(&theResultWriter);
  
  			theProcessor.process(
  						theInputSource,
  						&theStylesheetSource,
  						theResultTarget,
  						theConstructionContext,
  						theExecutionContext);
  		}
  		catch(...)
  		{
  			cerr << "Exception caught!!!"
  				 << endl
  				 << endl;
  		}
  	}
  
  	return 0;
  }
  
  
  
  1.1                  xml-xalan/c/samples/SimpleTransform/SimpleTransform.dsp
  
  Index: SimpleTransform.dsp
  ===================================================================
  # Microsoft Developer Studio Project File - Name="SimpleTransform" - Package Owner=<4>
  # Microsoft Developer Studio Generated Build File, Format Version 6.00
  # ** DO NOT EDIT **
  
  # TARGTYPE "Win32 (x86) Console Application" 0x0103
  
  CFG=SimpleTransform - Win32 Debug
  !MESSAGE This is not a valid makefile. To build this project using NMAKE,
  !MESSAGE use the Export Makefile command and run
  !MESSAGE 
  !MESSAGE NMAKE /f "SimpleTransform.mak".
  !MESSAGE 
  !MESSAGE You can specify a configuration when running NMAKE
  !MESSAGE by defining the macro CFG on the command line. For example:
  !MESSAGE 
  !MESSAGE NMAKE /f "SimpleTransform.mak" CFG="SimpleTransform - Win32 Debug"
  !MESSAGE 
  !MESSAGE Possible choices for configuration are:
  !MESSAGE 
  !MESSAGE "SimpleTransform - Win32 Release" (based on "Win32 (x86) Console Application")
  !MESSAGE "SimpleTransform - Win32 Debug" (based on "Win32 (x86) Console Application")
  !MESSAGE 
  
  # Begin Project
  # PROP AllowPerConfigDependencies 0
  # PROP Scc_ProjName ""
  # PROP Scc_LocalPath ""
  CPP=cl.exe
  RSC=rc.exe
  
  !IF  "$(CFG)" == "SimpleTransform - Win32 Release"
  
  # PROP BASE Use_MFC 0
  # PROP BASE Use_Debug_Libraries 0
  # PROP BASE Output_Dir "Release"
  # PROP BASE Intermediate_Dir "Release"
  # PROP BASE Target_Dir ""
  # PROP Use_MFC 0
  # PROP Use_Debug_Libraries 0
  # PROP Output_Dir "..\..\Build\Win32\VC6\Release"
  # PROP Intermediate_Dir "..\..\Build\Win32\VC6\Release\SimpleTransform"
  # PROP Ignore_Export_Lib 0
  # PROP Target_Dir ""
  # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
  # ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "..\..\..\..\xml-xerces\c\src" /I "..\..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
  # ADD BASE RSC /l 0x409 /d "NDEBUG"
  # ADD RSC /l 0x409 /d "NDEBUG"
  BSC32=bscmake.exe
  # ADD BASE BSC32 /nologo
  # ADD BSC32 /nologo
  LINK32=link.exe
  # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
  # ADD LINK32 ..\..\..\..\xml-xerces\c\Build\Win32\VC6\Release\*.lib ..\..\Build\Win32\VC6\Release\*.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
  
  !ELSEIF  "$(CFG)" == "SimpleTransform - Win32 Debug"
  
  # PROP BASE Use_MFC 0
  # PROP BASE Use_Debug_Libraries 1
  # PROP BASE Output_Dir "Debug"
  # PROP BASE Intermediate_Dir "Debug"
  # PROP BASE Target_Dir ""
  # PROP Use_MFC 0
  # PROP Use_Debug_Libraries 1
  # PROP Output_Dir "..\..\Build\Win32\VC6\Debug"
  # PROP Intermediate_Dir "..\..\Build\Win32\VC6\Debug\SimpleTransform"
  # PROP Ignore_Export_Lib 0
  # PROP Target_Dir ""
  # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
  # ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "..\..\..\..\xml-xerces\c\src" /I "..\..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "XML_DEBUG" /YX /FD /GZ /c
  # ADD BASE RSC /l 0x409 /d "_DEBUG"
  # ADD RSC /l 0x409 /d "_DEBUG"
  BSC32=bscmake.exe
  # ADD BASE BSC32 /nologo
  # ADD BSC32 /nologo
  LINK32=link.exe
  # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
  # ADD LINK32 ..\..\..\..\xml-xerces\c\Build\Win32\VC6\Debug\*.lib ..\..\Build\Win32\VC6\Debug\*.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
  
  !ENDIF 
  
  # Begin Target
  
  # Name "SimpleTransform - Win32 Release"
  # Name "SimpleTransform - Win32 Debug"
  # Begin Group "Source Files"
  
  # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
  # Begin Source File
  
  SOURCE=.\SimpleTransform.cpp
  # End Source File
  # End Group
  # Begin Group "Header Files"
  
  # PROP Default_Filter "h;hpp;hxx;hm;inl"
  # End Group
  # Begin Group "Resource Files"
  
  # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
  # End Group
  # End Target
  # End Project
  
  
  
  1.1                  xml-xalan/c/samples/SimpleTransform/SimpleTransform.dsw
  
  Index: SimpleTransform.dsw
  ===================================================================
  Microsoft Developer Studio Workspace File, Format Version 6.00
  # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
  
  ###############################################################################
  
  Project: "SimpleTransform"=".\SimpleTransform.dsp" - Package Owner=<4>
  
  Package=<5>
  {{{
  }}}
  
  Package=<4>
  {{{
  }}}
  
  ###############################################################################
  
  Global:
  
  Package=<5>
  {{{
  }}}
  
  Package=<3>
  {{{
  }}}
  
  ###############################################################################