[GME-commit]
GMESRC/GME/Parser MgaXslt.cpp,NONE,1.1 MgaXslt.h,NONE,1.1
MgaXslt.rgs,NONE,1.1 Parser.cpp,1.3,1.4 Parser.dsp,1.10,1.11
Parser.rc,1.5,1.6 ParserLib.idl,1.3,1.4 resource.h,1.2,1.3
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Thu Apr 8 14:02:59 CDT 2004
- Previous message: [GME-commit] GMESRC/GME/MgaUtil MgaXsltFileSel.rgs,NONE,1.1
XsltDial.cpp,NONE,1.1 XsltDial.h,NONE,1.1 XsltFileSel.cpp,NONE,1.1
XsltFileSel.h,NONE,1.1 MgaUtil.dsp,1.21,1.22 MgaUtil.rc,1.33,1.34
MgaUtilApp.cpp,1.6,1.7 MgaUtilLib.idl,1.5,1.6 resource.h,1.20,1.21
- Next message: [GME-commit] GMESRC/Tools/GMETableEditor Component.dsp,1.5,1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/lib/gme/GMESRC/GME/Parser
In directory braindrain:/tmp/cvs-serv26784/Parser
Modified Files:
Parser.cpp Parser.dsp Parser.rc ParserLib.idl resource.h
Added Files:
MgaXslt.cpp MgaXslt.h MgaXslt.rgs
Log Message:
Adding XSLT related files into MgaUtil and Parser.
Interfaces changed: Parser.idl, MgaUtil.idl
Modified Files:
Common/CommonError.h Gme/GMEApp.cpp
Interfaces/InterfaceVersion.h Interfaces/MgaUtil.idl
Interfaces/Parser.idl MgaUtil/MgaUtil.dsp MgaUtil/MgaUtil.rc
MgaUtil/MgaUtilApp.cpp MgaUtil/MgaUtilLib.idl
MgaUtil/resource.h Parser/Parser.cpp Parser/Parser.dsp
Parser/Parser.rc Parser/ParserLib.idl Parser/resource.h
Added Files:
MgaUtil/MgaXsltFileSel.rgs MgaUtil/XsltDial.cpp
MgaUtil/XsltDial.h MgaUtil/XsltFileSel.cpp
MgaUtil/XsltFileSel.h Parser/MgaXslt.cpp Parser/MgaXslt.h
Parser/MgaXslt.rgs
CVS User: zolmol
--- NEW FILE: MgaXslt.cpp ---
#include "stdafx.h"
#include "MgaXslt.h"
#include "CommonStl.h"
#if(1)
#include <xalanc/Include/PlatformDefinitions.hpp>
//#include <cassert>
#if defined(XALAN_CLASSIC_IOSTREAMS)
#include "fstream.h"
#include "iostream.h"
#include "strstrea.h"
#else
#include "fstream"
#include "iostream"
#include "strstream"
#endif
#include <xercesc/util/PlatformUtils.hpp>
#include <xalanc/XalanTransformer/XalanTransformer.hpp>
#endif
#define SIZE_OF_BUFFER 1024 //for storing filenames
int CMgaXslt::transform(
const char * stylesheet_file,
const char * input_file,
const char * output_file/*,
string& error_msg*/)
{
/*error_msg = "";*/
#if(1)
XALAN_USING_STD(cerr)
XALAN_USING_STD(endl)
XALAN_USING_STD(ostrstream)
XALAN_USING_STD(ends)
XALAN_USING_XERCES(XMLPlatformUtils)
XALAN_USING_XERCES(XMLException)
XALAN_USING_XALAN(XalanTransformer)
XALAN_USING_XALAN(XalanCompiledStylesheet)
int theResult = 0;
// Call the static initializer for Xerces.
try
{
XMLPlatformUtils::Initialize();
}
catch (const XMLException& toCatch)
{
//XmlStr xml_str( toCatch.getMessage());
//error_msg = xml_str;
//error_msg = toCatch.getMessage();
theResult = E_XSLT_XERCES_INIT;
}
if ( theResult == 0)
{
// Initialize Xalan.
XalanTransformer::initialize();
// Create a XalanTransformer.
XalanTransformer theXalanTransformer;
const char* theXSLFileName = stylesheet_file;
// Compile the stylesheet.
const XalanCompiledStylesheet* theCompiledStylesheet = 0;
theResult = theXalanTransformer.compileStylesheet(theXSLFileName, theCompiledStylesheet);
if (theResult == 0)
{
assert(theCompiledStylesheet != 0);
// Buffers passed in to ostrstream.
char inBuffer[SIZE_OF_BUFFER];
char outBuffer[SIZE_OF_BUFFER];
// Generate the input and output file names.
ostrstream theFormatterIn(inBuffer, sizeof(inBuffer));
ostrstream theFormatterOut(outBuffer, sizeof(outBuffer));
theFormatterIn << input_file << '\0';
theFormatterOut << output_file << '\0';
// Do the transform.
theResult = theXalanTransformer.transform(
inBuffer,
theCompiledStylesheet,
outBuffer);
// I don't have to do this, since the transformer will
// clean this up when it's destroyed, but why not...
theResult = theXalanTransformer.destroyStylesheet(theCompiledStylesheet);
}
if ( theResult != 0)
{
/*error_msg = theXalanTransformer.getLastError();*/
theResult = E_XSLT_TRANSF_ERROR;
}
}
// Terminate Xalan...
XalanTransformer::terminate();
// Terminate Xerces...
XMLPlatformUtils::Terminate();
// Clean up the ICU, if it's integrated.
XalanTransformer::ICUCleanUp();
return theResult;
#endif
}
STDMETHODIMP CMgaXslt::ApplyXslt( BSTR p_stylesheet_f_name, BSTR p_in_f_name, BSTR p_out_f_name/*, BSTR * p_error_msg*/)
{
string style_sheet, in_file, out_file, error_msg;
CopyTo( p_stylesheet_f_name, style_sheet);
CopyTo( p_in_f_name, in_file);
CopyTo( p_out_f_name, out_file);
try
{
int res = transform( style_sheet.c_str(), in_file.c_str(), out_file.c_str()/*, error_msg*/);
if ( res != 0)
{
//if ( !error_msg.empty()) CopyTo( error_msg.c_str(), error_msg.length(), p_error_msg);
return res;
}
}
catch( ...) //hresult_exception &e)
{
return E_XSLT_ERROR;
}
return S_OK;
}
--- NEW FILE: MgaXslt.h ---
#ifndef MGAXSLT_H_10983845732874589762348ajhdfkjasdhfbj
#define MGAXSLT_H_10983845732874589762348ajhdfkjasdhfbj
#include "resource.h"
#include "CommonVersionInfo.h"
// --------------------------- CMgaXslt
class ATL_NO_VTABLE CMgaXslt
: public CComObjectRootEx<CComSingleThreadModel>
, public CComCoClass<CMgaXslt, &CLSID_MgaXslt>
, public ISupportErrorInfoImpl<&IID_IMgaXslt>
, public IDispatchImpl<IMgaXslt, &IID_IMgaXslt, &LIBID_PARSERLib>
, public IMgaVersionInfoImpl
//, public IMgaXslt
{
public:
CMgaXslt() { }
~CMgaXslt() { }
DECLARE_REGISTRY_RESOURCEID(IDR_MGAXSLT)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CMgaXslt)
COM_INTERFACE_ENTRY(IMgaXslt)
END_COM_MAP()
// ------- Properties
STDMETHOD(ApplyXslt)( BSTR in1, BSTR in2, BSTR in3/*, BSTR* msg*/);
// ------- Attributes and Methods
protected:
transform( const char * stylesheet, const char * in, const char * out/*, string& msg*/ );
public:
};
#endif // MGAXSLT_H_10983845732874589762348ajhdfkjasdhfbj
--- NEW FILE: MgaXslt.rgs ---
HKCR
{
Mga.MgaXslt.1 = s 'MgaXslt Class'
{
CLSID = s '{2C9DF78A-92C2-4994-8AAC-BFA8007BBCD7}'
}
Mga.MgaXslt = s 'MgaXslt Class'
{
CLSID = s '{2C9DF78A-92C2-4994-8AAC-BFA8007BBCD7}'
CurVer = s 'Mga.MgaXslt.1'
}
NoRemove CLSID
{
ForceRemove {2C9DF78A-92C2-4994-8AAC-BFA8007BBCD7} = s 'MgaXslt Class'
{
ProgID = s 'Mga.MgaXslt.1'
VersionIndependentProgID = s 'Mga.MgaXslt'
ForceRemove 'Programmable'
InprocServer32 = s '%MODULE%'
{
val ThreadingModel = s 'Apartment'
}
'TypeLib' = s '{461F30AE-3BF0-11D4-B3F0-005004D38590}'
}
}
}
Index: Parser.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Parser/Parser.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Parser.cpp 26 Jul 2001 19:36:00 -0000 1.3
--- Parser.cpp 8 Apr 2004 18:02:56 -0000 1.4
***************
*** 40,43 ****
--- 40,44 ----
#include "MgaDumper.h"
#include "MgaParser.h"
+ #include "MgaXslt.h"
#ifdef _MERGE_PROXYSTUB
***************
*** 51,54 ****
--- 52,56 ----
OBJECT_ENTRY(CLSID_MgaDumper, CMgaDumper)
OBJECT_ENTRY(CLSID_MgaParser, CMgaParser)
+ OBJECT_ENTRY(CLSID_MgaXslt, CMgaXslt)
END_OBJECT_MAP()
Index: Parser.dsp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Parser/Parser.dsp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Parser.dsp 8 Apr 2004 08:34:25 -0000 1.10
--- Parser.dsp 8 Apr 2004 18:02:56 -0000 1.11
***************
*** 142,145 ****
--- 142,149 ----
# Begin Source File
+ SOURCE=.\MgaXslt.cpp
+ # End Source File
+ # Begin Source File
+
SOURCE=.\Parser.cpp
# End Source File
***************
*** 191,194 ****
--- 195,202 ----
# Begin Source File
+ SOURCE=.\MgaXslt.h
+ # End Source File
+ # Begin Source File
+
SOURCE=.\Resource.h
# End Source File
***************
*** 212,215 ****
--- 220,227 ----
SOURCE=.\MgaParser.rgs
+ # End Source File
+ # Begin Source File
+
+ SOURCE=.\MgaXslt.rgs
# End Source File
# End Group
Index: Parser.rc
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Parser/Parser.rc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Parser.rc 3 Feb 2004 10:53:04 -0000 1.5
--- Parser.rc 8 Apr 2004 18:02:56 -0000 1.6
***************
*** 99,102 ****
--- 99,103 ----
IDR_MGADUMPER REGISTRY DISCARDABLE "MgaDumper.rgs"
IDR_MGAPARSER REGISTRY DISCARDABLE "MgaParser.rgs"
+ IDR_MGAXSLT REGISTRY DISCARDABLE "MgaXslt.rgs"
/////////////////////////////////////////////////////////////////////////////
***************
*** 105,110 ****
//
! EDF.DTD DTD DISCARDABLE "edf.dtd"
! MGA.DTD DTD DISCARDABLE "mga.dtd"
/////////////////////////////////////////////////////////////////////////////
--- 106,111 ----
//
! EDF.DTD DTD DISCARDABLE "edf.dtd"
! MGA.DTD DTD DISCARDABLE "mga.dtd"
/////////////////////////////////////////////////////////////////////////////
Index: ParserLib.idl
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Parser/ParserLib.idl,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ParserLib.idl 26 Jul 2001 19:36:00 -0000 1.3
--- ParserLib.idl 8 Apr 2004 18:02:56 -0000 1.4
***************
*** 51,53 ****
--- 51,63 ----
interface IMgaVersionInfo;
};
+
+ [
+ uuid(2C9DF78A-92C2-4994-8AAC-BFA8007BBCD7),
+ helpstring("MgaXslt Class")
+ ]
+ coclass MgaXslt
+ {
+ [default] interface IMgaXslt;
+ interface IMgaVersionInfo;
+ };
};
Index: resource.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Parser/resource.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** resource.h 28 Jul 2001 06:12:00 -0000 1.2
--- resource.h 8 Apr 2004 18:02:56 -0000 1.3
***************
*** 9,12 ****
--- 9,13 ----
#define EDFDTD 206
#define MGADTD 207
+ #define IDR_MGAXSLT 208
// Next default values for new objects
***************
*** 14,18 ****
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
! #define _APS_NEXT_RESOURCE_VALUE 208
#define _APS_NEXT_COMMAND_VALUE 32768
#define _APS_NEXT_CONTROL_VALUE 201
--- 15,19 ----
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
! #define _APS_NEXT_RESOURCE_VALUE 210
#define _APS_NEXT_COMMAND_VALUE 32768
#define _APS_NEXT_CONTROL_VALUE 201
- Previous message: [GME-commit] GMESRC/GME/MgaUtil MgaXsltFileSel.rgs,NONE,1.1
XsltDial.cpp,NONE,1.1 XsltDial.h,NONE,1.1 XsltFileSel.cpp,NONE,1.1
XsltFileSel.h,NONE,1.1 MgaUtil.dsp,1.21,1.22 MgaUtil.rc,1.33,1.34
MgaUtilApp.cpp,1.6,1.7 MgaUtilLib.idl,1.5,1.6 resource.h,1.20,1.21
- Next message: [GME-commit] GMESRC/Tools/GMETableEditor Component.dsp,1.5,1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the GME-commit
mailing list