I built an executable using your code with Xalan 1.3. on Windows 2000 and
did not encounter any problems.
Things to check:
1. Are you using the correct run-time libraries? This is documented for
both Xalan and Xerces. You must use the correct Multithreaded DLL
run-time library. Make sure you use the Debug run-time for debug
builds, and the release run-time for release builds.
2. Are you sure that you've got your MS environment at the right level?
You must have at least SP3 and you must apply the Dinkumware patches as
explained in the documentation, unless the Service Pack you're using
includes these patches. See here for more information about operating
systems and supported compilers:
http://xml.apache.org/xalan-c/
Dave
"+Z5c- +W1CCrw-"
<[EMAIL PROTECTED] To:
[email protected]
tmail.com> cc:
Subject: Re: Problems with using
xalan API
01/28/2002
03:24 AM
Hi
this is referring back to the same problem, following your instruction i
still gets runtime error, here is a little test program i have written: -
#include<iostream>
#include <Include+AFw-PlatformDefinitions.hpp>
#include <util+AFw-PlatformUtils.hpp>
#include <XalanTransformer+AFw-XalanTransformer.hpp>
void xml_output_conversion();
int main(int argc, const char* argv[])
{
XMLPlatformUtils::Initialize();
XalanTransformer::initialize();
std::cout<<"Hello+AFw-n";
for (int a=0; a<10; +-+-a)
{
xml_output_conversion();
std::cout<< "a ="<<a;
}
XalanTransformer::terminate();
XMLPlatformUtils::Terminate();
return 0;
}
void xml_output_conversion()
{
XSLTInputSource xmlIn("results.xml");
XSLTInputSource xslIn ("xsltres2.xsl");
XSLTResultTarget xmlOut ("results.html");
XalanTransformer theXalanTransformer;
theXalanTransformer.transform(xmlIn, xslIn, xmlOut);
return;
}
in the debug section it gives me the following error messages: -
"First-chance exception in test x.exe (XERCES-C_1_6_0.DLL): 0xC0000005:
Access Violation."
if appropiate, the following attachment is the project workspace file (just
to make sure that all the dependencies are set correctly)
sorry about being such a pest to you Once again i would like to thank you
for your help
regards
Kit
>From: "David N Bertoni/CAM/Lotus" <[EMAIL PROTECTED]>
>To: [email protected]
>Subject: Re: Problems with using xalan API
>Date: Thu, 24 Jan 2002 11:10:45 -0800
>
>
>It's difficult from your post to determine whether or not you've followed
>my previous advice. Here's an example of what I'm talking about:
>
> void
> xml_output_conversion()
> {
> const XSLTInputSource xmlIn("Results/results.xml");
> const XSLTInputSource xslIn("xsltres2.xsl");
> const XSLTResultTarget xmlOut("Results/results.html");
>
> XalanTransformer theXalanTransformer;
>
> theXalanTransformer.transform(xmlIn, xslIn, xmlOut);
>
> return;
> }
>
> void
> opt_xml_to_html()
> {
> xml_output_conversion();
>
> cerr << "Files are created, please go and look it up in the
Results
> Directory+-AFw-n";
>
> return;
> }
>
> int
> main(
> int argc,
> const char* argv[])
> {
> try
> {
> // Must initialize Xerces _before_ Xalan...
> XMLPlatformUtils::Initialize();
> XalanTransformer::initialize();
>
> for(int i = 0; i < 10; +--+--i)
> {
> opt_xml_to_html();
> }
>
> // Must terminate Xalan _before_ Xerces...
> XalanTransformer::terminate();
> XMLPlatformUtils::Terminate();
> }
> catch(...)
> {
> cerr << "Exception caught..." << endl;
> }
> }
>
>If you can _still_ reproduce a crash once you're code has been corrected,
>then you should file a bug report with a _minimal_ test case so we can try
>to diagnose the problem.
>
>Dave
_________________________________________________________________
+Vyg- http://explorer.msn.com.hk/intl.asp +UU2Mu04Ljwk- MSN Explorer