Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > xalan-c 1.10 problem with XalanTransformer.transform

Reply
Thread Tools

xalan-c 1.10 problem with XalanTransformer.transform

 
 
rjuszkiewicz@gmail.com
Guest
Posts: n/a
 
      12-04-2012
Hello,
I have a problem with transforming a few streams. First stream always goes
correctly, while second is transforming, I receive:

XSLT Warning: Fatal Error.Occurred at unknown file, line 1, column 1. Invalid
document structure (line 1, column 1.)
SAXParseException: Invalid document structure (, line 1, column 1)

Why ? What's wrong with my code ?

void generate_traces(
const std::string targetIP,
unsigned iterationsNumber,
unsigned connectionsNumber,
unsigned instancesNumber,
const std::string traceType,
const std::string dir,
unsigned sleepTime,
const std::string traceMode,
unsigned isBinary = 0
)
{
XmlPlatformJanitor xercesJanitor;
xalanc::XalanTransformer::initialize();
xalanc::XalanTransformer theXalanTransformer;


std::list<std::string> contentList;
if (fs::is_directory(dir))
{
std::string tempString;
for (fs::directory_iterator itr(dir); itr!=fs::directory_iterator();
++itr)
{
if (fs::is_regular_file(itr->status()) && strcmp(itr-
>path().extension().c_str(),".xml")==0)

{
std::cout << itr->path().filename() << ' ' << itr-
>path().extension() << '\n'; // display filename only


std::ifstream ifs(itr->path().string().c_str());
contentList.push_front(tempString.assign(
(std::istreambuf_iterator<char>(ifs)), (std::istreambuf_iterator<char>()) ));
}
}
}


// stream xsl
std::stringstream xsl_stream(std::stringstream::in | std::stringstream:ut);
xsl_stream << pmtrace::generateXsl<pmtrace::MsgReport>();

xalanc::XSLTInputSource xslIn(xsl_stream);
std::list< std::list<std::string> > streamsList;
std::list<std::string> streamList;


//generating data streams
for (int i=0; i<instancesNumber; i++)
{
std::string uniqueMccMncId = get_number_full_string();
std::string uniqueTraceId = get_number_full_string();
for (std::list<std::string>::const_iterator it = contentList.begin(); it
!= contentList.end(); ++it)
{
std::stringstream result_stream(std::stringstream::in |
std::stringstream:ut);
std::stringstream tempstream(std::stringstream::in |
std::stringstream:ut);

std::string s = *it;

tempstream << s;

xalanc::XSLTInputSource xmlIn(tempstream);

xalanc::XSLTResultTarget xmlOut(result_stream);

int theResult = theXalanTransformer.transform(xmlIn, xslIn, xmlOut);
if(theResult != 0)
{
std::cout << theXalanTransformer.getLastError() << std::endl;
}

streamList.push_back(result_stream.str());
}
streamsList.push_back(streamList);
streamList.clear();
}

//print_list_of_list_of_string(streamsList);
std::cout << "Size: " << streamsList.size() << "\n";

xalanc::XalanTransformer::terminate();
xalanc::XalanTransformer::ICUCleanUp();
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem problem problem :( Need Help Mike ASP General 2 05-11-2004 08:36 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57