2002-11-23 20:54:58 +01:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
# pragma warning(disable:4786)
|
|
|
|
#endif
|
2002-06-21 13:16:28 +02:00
|
|
|
|
2002-09-02 17:50:43 +02:00
|
|
|
#include <SAX/XMLReader.h>
|
2002-06-21 13:16:28 +02:00
|
|
|
#include <SAX/helpers/FeatureNames.h>
|
|
|
|
#include <SAX/InputSource.h>
|
|
|
|
#include <iostream>
|
|
|
|
#include <SAX/filter/Writer.h>
|
|
|
|
|
|
|
|
////////////////////////////////////////////////
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
if(argc < 2)
|
|
|
|
{
|
|
|
|
std::cout << "Usage : " << argv[0] << " xmlfile ... " << std::endl;
|
|
|
|
return 0;
|
|
|
|
} // if(argc < 2)
|
|
|
|
|
2003-08-27 16:28:41 +02:00
|
|
|
/*
|
|
|
|
{ // narrow
|
|
|
|
SAX::FeatureNames<std::string> fNames;
|
|
|
|
SAX::XMLReader<std::string> parser;
|
|
|
|
SAX::Writer writer(std::cout);
|
|
|
|
writer.setParent(parser);
|
|
|
|
|
|
|
|
for(int i = 1; i < argc; ++i)
|
2002-06-21 13:16:28 +02:00
|
|
|
{
|
2003-08-27 16:28:41 +02:00
|
|
|
std::string file(argv[i]);
|
|
|
|
SAX::InputSource is;
|
|
|
|
is.setSystemId(file);
|
|
|
|
|
|
|
|
if(file != "-")
|
|
|
|
writer.parse(is);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
is.setSystemId("stdin");
|
|
|
|
is.setByteStream(std::cin);
|
|
|
|
|
|
|
|
writer.parse(is);
|
|
|
|
} // if(file != "-")
|
|
|
|
} // for ...
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
{ // wide
|
|
|
|
SAX::FeatureNames<std::wstring> fNames;
|
|
|
|
SAX::XMLReader<std::wstring> parser;
|
|
|
|
SAX::wWriter writer(std::wcout);
|
|
|
|
writer.setParent(parser);
|
|
|
|
|
|
|
|
SAX::wInputSource is;
|
|
|
|
is.setSystemId(L"stdin");
|
|
|
|
is.setByteStream(std::cin);
|
|
|
|
|
|
|
|
writer.parse(is);
|
|
|
|
}
|
2002-06-21 13:16:28 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
} // main
|
|
|
|
|
|
|
|
// end of file
|