161
167
void parseXML(struct TestData *td, unsigned long iter) {
166
while ((td->xml[i] == ' ')||(td->xml[i] == '\r')||(td->xml[i] == '\n')||(td->xml[i] == '\t')) i++;
167
if ((td->xml[i]=='<')&&(td->xml[i+1]=='?')) {
168
for (i+=2;((td->xml[i]!='?')||(td->xml[i+1]!='>'))&&(td->xml[i]);i++);
169
for (i+=2;(td->xml[i] == ' ')||(td->xml[i] == '\r')||(td->xml[i] == '\n')||(td->xml[i] == '\t');i++);
170
if ((td->xml[i]=='<')&&(td->xml[i+1]=='?')) {
171
for (i+=2;((td->xml[i]!='?')||(td->xml[i+1]!='>'))&&(td->xml[i]);i++);
172
for (i+=2;(td->xml[i] == ' ')||(td->xml[i] == '\r')||(td->xml[i] == '\n')||(td->xml[i] == '\t');i++);
175
173
e = new Entity_Info;
176
174
m = new Model_Info;
177
e->AnalyzeSignature((unsigned char*)"<?xml");
175
e->AnalyzeSignature((unsigned char*)"<?xm");
176
b = Byteplex::ByteplexFactory(e, (unsigned char*)td->xml, td->xmllen);
177
// printf("%u %u\n", td->xmllen, strlen(td->xml));
180
b->PreparePseudoASCII_Stream();
181
XML_Decl_Parser<ASCII> decl_parser(b);
182
decl_parser.ReadXMLInfo(*e);
184
Crashes due to the limited buffer size in byteplex.h and some other reasons
180
187
parser = Parser_Interface<UTF_8>::ParserFactory("/tmp/parabix.test");//td->xml+i, td->xmllen-i, e, m);
188
// parser = new ParsingEngine<X8_Buffer<ASCII>, UTF_8>(e, m, b, false);
189
// parser = new ParsingEngine<UTF8_Buffer, UTF_8>(e, m, b, false);
181
190
parser->Parse_Prolog();
182
191
parser->Parse_DocumentContent();
183
// parser->~Parser_Interface();
191
195
int main(int argc, char *argv[]) {