XalanTransformer 输出到标准输出?

XalanTransformer output to standard out?

使用 Xalan 我有一个 XalanTransformer,它可以将输出生成到一个文件中。我如何让它转为标准输出?

#include <sstream>
#include <xalanc/Include/PlatformDefinitions.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <xalanc/XalanTransformer/XalanTransformer.hpp>
constexpr auto REPORT_FILE {"report.html"};
....
std::stringstream xml_doc; xml_doc << ....;
std::stringstream style_sheet; style_sheet << ....;
XALAN_USING_XERCES(XMLPlatformUtils)
XALAN_USING_XALAN(XalanTransformer)
XMLPlatformUtils::Initialize();
XalanTransformer::initialize();
XalanTransformer transformer;
transformer.transform(xml_doc, style_sheet, REPORT_FILE);
#include <iostream>

if (transformer.transform(xml_doc, style_sheet, std::cout) != 0)

The global objects std::cout and std::wcout control output to a stream buffer of implementation-defined type (derived from std::streambuf), associated with the standard C output stream stdout.

cppreference.com std::cout