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/08/08 17:34:29 UTC
cvs commit: xml-xalan/c/Tests/Dom2Dom dom2dom.cpp
dbertoni 01/08/08 08:34:29
Modified: c/Tests/Dom2Dom dom2dom.cpp
Log:
Cleaned-up some.
Revision Changes Path
1.2 +32 -23 xml-xalan/c/Tests/Dom2Dom/dom2dom.cpp
Index: dom2dom.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Dom2Dom/dom2dom.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- dom2dom.cpp 2001/06/12 19:43:09 1.1
+++ dom2dom.cpp 2001/08/08 15:34:29 1.2
@@ -90,8 +90,8 @@
#include <FileUtility.hpp>
#include <HarnessInit.hpp>
-#include <parsers/DOMParser.hpp>
-#include <dom/DOM_Node.hpp>
+//#include <parsers/DOMParser.hpp>
+//#include <dom/DOM_Node.hpp>
#include <XercesParserLiaison/XercesDOMSupport.hpp>
#include <XercesParserLiaison/XercesParserLiaison.hpp>
@@ -317,36 +317,45 @@
const XSLTInputSource xslInputSource(c_wstr(theXSLFile));
const XSLTInputSource xmlInputSource(c_wstr(theXMLFile));
- const XalanCompiledStylesheet* const compiledSS = transformEngine.compileStylesheet(xslInputSource);
- assert( compiledSS != 0);
+ const XalanCompiledStylesheet* compiledSS = 0;
- // Transform using compiled stylesheet.
- int theResult =
- transformEngine.transform(xmlInputSource, compiledSS, domResultTarget);
+ int theResult = transformEngine.compileStylesheet(
+ xslInputSource,
+ compiledSS);
- if(theResult != 0)
+ if (theResult != 0)
{
logFile.logTestCaseClose("Done","Fail");
cerr << "XalanError: \n" << transformEngine.getLastError();
}
else
{
- XalanFileOutputStream myOutput(theOutputFile);
- XalanOutputStreamPrintWriter myResultWriter(myOutput);
- FormatterListener* theFormatter = getXMLFormatter(true,true,true,false,
- myResultWriter,0,
- mimeEncoding,
- compiledSS->getStylesheetRoot());
-
- FormatterTreeWalker theTreeWalker(*theFormatter);
- theTreeWalker.traverse(domOut);
-
- delete theFormatter;
- logFile.logTestCaseClose("Done","Pass");
- }
-
+ // Transform using compiled stylesheet.
+ theResult =
+ transformEngine.transform(xmlInputSource, compiledSS, domResultTarget);
+
+ if(theResult != 0)
+ {
+ logFile.logTestCaseClose("Done","Fail");
+ cerr << "XalanError: \n" << transformEngine.getLastError();
+ }
+ else
+ {
+ XalanFileOutputStream myOutput(theOutputFile);
+ XalanOutputStreamPrintWriter myResultWriter(myOutput);
+ FormatterListener* theFormatter = getXMLFormatter(true,true,true,false,
+ myResultWriter,0,
+ mimeEncoding,
+ compiledSS->getStylesheetRoot());
+
+ FormatterTreeWalker theTreeWalker(*theFormatter);
+ theTreeWalker.traverse(domOut);
+
+ delete theFormatter;
+ logFile.logTestCaseClose("Done","Pass");
+ }
+ }
}
-
}
XalanTransformer::terminate();
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org