[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] problem encounter whilst intergating the xalan API
Hi,
I was wandering whether had a similiar problem of integating the c++ API of xalan into your own program... at present i am using xalan C++ ver. 1.3 for my own application, following what is written on the usage pattern in the website (http://xml.apache.org/xalan-c/usagepatterns.html#xalantransformer). it managed to complied and intergrated into my program. however, there are few problem occurs... it seems during run time, if i was trying to call this function (or choose this option in my application) more than once it will crash my program instantly. i have tried and take the XMLPlatformUtils::Terminate() out of the program, yes this allows me to call the function more than once but further problem developes as it will crash randomly. Here are the code of my application... The function for xslt transformation void xml_output_conversion() { XMLPlatformUtils::Initialize(); XalanTransformer::initialize(); XalanTransformer theXalanTransformer; XSLTInputSource xmlIn("Results/results.xml"); XSLTInputSource xslIn ("xsltres2.xsl"); XSLTResultTarget xmlOut ("Results/results.html"); int TheResulT= theXalanTransformer.transform(xmlIn, xslIn, xmlOut); XMLPlatformUtils::Terminate(); /*XalanTransformer::terminate() is responisble Terminate Xalan*/ XalanTransformer::terminate(); return; } and the function responsible of calling this above function that lies in my main program... void opt_xml_to_html() { xml_output_conversion(); cerr << "Files are created, please go and look it up in the Results Directory\n"; return; } i have tried and move XMLPlatformUtils::Initialize() and XalanTransformer::initialize() to the beginning of the main function {the start of main () }, and move the XMLPlatformUtils::Terminate() and XalanTransformer::terminate() to the end of the main function. however, i am still getting the same problem. I have also try and move those call into opt_xml_to_html() (see previous question)but that also not working, whilst i was trying to debug it it tells me that access violation in my execute file (NTDLL.Dll, XSLT.DLL). i was wandering whether there is a fault with the way I have written the application or something, i will be grateful if someone will be kind enough to help me out Many Thanks Kit P.S.1 i am developing my application in MSVC++ 6 with ServicePack 5, would that cause any problem? P.S.2 apologise to David Bertoni, to whom i cause so much inconvience to. _________________________________________________________________ ¨Ï¥Î MSN Messenger »PªB¤Í¦b½u¤W²á¤Ñ¡Ghttp://messenger.microsoft.com/tc¡C XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|