dbertoni 00/09/19 08:16:20
Modified: c/src/TestXSLT process.cpp
Log:
Changes for AIX port and for output transcoding.
Revision Changes Path
1.39 +27 -40 xml-xalan/c/src/TestXSLT/process.cpp
Index: process.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/TestXSLT/process.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- process.cpp 2000/09/05 15:45:34 1.38
+++ process.cpp 2000/09/19 15:16:16 1.39
@@ -62,7 +62,6 @@
#include <cstdio>
#include <cstring>
#include <iostream>
-#include <string>
#include <strstream>
@@ -157,7 +156,6 @@
using std::hex;
using std::less;
using std::map;
-using std::string;
using std::vector;
#endif
@@ -241,7 +239,7 @@
-typedef map<string, string, less<string> > String2StringMapType;
+typedef map<CharVectorType, CharVectorType, less<CharVectorType> >
String2StringMapType;
@@ -269,10 +267,10 @@
#endif
int indentAmount;
int outputType;
- string outFileName;
- string specialCharacters;
- string xslFileName;
- string inFileName;
+ CharVectorType outFileName;
+ CharVectorType specialCharacters;
+ CharVectorType xslFileName;
+ CharVectorType inFileName;
CmdLineParams() :
paramsMap(),
@@ -352,7 +350,7 @@
if(i < argc && argv[i][0] != '-')
{
- p.inFileName = argv[i];
+ CopyStringToVector(argv[i], p.inFileName);
}
else
{
@@ -365,7 +363,7 @@
if(i < argc && argv[i][0] != '-')
{
- p.xslFileName = argv[i];
+ CopyStringToVector(argv[i], p.xslFileName);
}
else
{
@@ -378,7 +376,7 @@
if(i < argc && argv[i][0] != '-')
{
- p.outFileName = argv[i];
+ CopyStringToVector(argv[i], p.outFileName);
}
else
{
@@ -391,7 +389,7 @@
if(i < argc && argv[i][0] != '-')
{
- p.specialCharacters = argv[i];
+ CopyStringToVector(argv[i],
p.specialCharacters);
}
else
{
@@ -425,15 +423,19 @@
if(i < argc && argv[i][0] != '-')
{
- const string name = argv[i];
+ CharVectorType name;
+ CopyStringToVector(argv[i], name);
+
++i;
// Don't check for '-' here, since that might
// be a valid character in a parameter value.
if(i < argc)
{
- const string expression = argv[i];
+ CharVectorType expression;
+
+ CopyStringToVector(argv[i], expression);
p.paramsMap[name] = expression;
}
@@ -655,7 +657,7 @@
}
else
{
- return new TextFileOutputStream(params.outFileName.c_str());
+ return new TextFileOutputStream(c_str(params.outFileName));
}
}
@@ -795,8 +797,8 @@
for ( ; it != params.paramsMap.end(); ++it)
{
processor.setStylesheetParam(
- (*it).first.c_str(),
- (*it).second.c_str());
+ c_str((*it).first),
+ c_str((*it).second));
}
}
@@ -808,7 +810,7 @@
xmlParserLiaison.setIndent(params.indentAmount);
}
- xmlParserLiaison.setSpecialCharacters(params.specialCharacters.c_str());
+ xmlParserLiaison.setSpecialCharacters(c_str(params.specialCharacters));
xmlParserLiaison.SetShouldExpandEntityRefs(params.shouldExpandEntityRefs);
xmlParserLiaison.setUseValidation(params.doValidation);
@@ -823,7 +825,7 @@
if(0 != params.xslFileName.size())
{
- xslFileName = params.xslFileName.c_str();
+ xslFileName = c_str(params.xslFileName);
}
const StylesheetRoot* stylesheet = 0;
@@ -863,9 +865,9 @@
// Do the transformation...
- XSLTInputSource theInputSource(params.inFileName.c_str());
+ XSLTInputSource theInputSource(c_str(params.inFileName));
- StylesheetExecutionContextDefault
theExecutionContext(processor,
+ StylesheetExecutionContextDefault theExecutionContext(processor,
theXSLProcessorSupport,
theXPathSupport,
theXObjectFactory);
@@ -1081,16 +1083,10 @@
catch (XSLException& e)
{
cout << "\nXSLException ";
-
- const string type =
DOMStringToStdString(e.getType());
-
- if (!type.empty())
- cout << "Type is : " << type << endl;
- const string msg =
DOMStringToStdString(e.getMessage());
+ cout << "Type is : " << e.getType() << endl;
- if (!msg.empty())
- cout << "Message is : " << msg << endl;
+ cout << "Message is : " << e.getMessage() <<
endl;
theResult = -1;
}
@@ -1098,26 +1094,17 @@
{
cout << "\nSAXException ";
- const string msg =
DOMStringToStdString(e.getMessage());
+ cout << "Message is : " << e.getMessage() <<
endl;
- if (!msg.empty())
- cout << "Message is : " << msg << endl;
-
theResult = -2;
}
catch (XMLException& e)
{
cout << "\nXMLException ";
-
- const string type =
DOMStringToStdString(e.getType());
-
- if (!type.empty())
- cout << "Type is : " << type << endl;
- const string msg =
DOMStringToStdString(e.getMessage());
+ cout << "Type is : " << e.getType() << endl;
- if (!msg.empty())
- cout << "Message is : " << msg << endl;
+ cout << "Message is : " << e.getMessage() <<
endl;
theResult = -3;
}