00001 /*************************************************************************** 00002 ofx_preproc.cpp 00003 00003">0000300470 tagname_idx++; 00471 } 00472 //cerr <<i<<endl; 00473 if(strip==true) 00474 { 00475 input_string.copy(buffer,(crop_end_idx-orig_tag_open_idx)+1,orig_tag_open_idx); 00476 message_out(INFO,"sanitize_proprietary_tags() (end tag or new tag) removed: "+string(buffer)); 00477 input_string.erase(orig_tag_open_idx,(crop_end_idx-orig_tag_open_idx)+1); 00478 i=orig_tag_open_idx-1; 00479 proprietary_tag=false; 00480 proprietary_closing_tag=false; 00481 closing_tag_open=false; 00482 tag_open=false; 00483 strip=false; 00484 } 00485 00486 }//end for 00487 if(proprietary_tag==true){ 00488 if(crop_end_idx==0){//no closing tag 00489 crop_end_idx=input_string.size()-1; 00490 } 00491 input_string.copy(buffer,(crop_end_idx-orig_tag_open_idx)+1,orig_tag_open_idx); 00492 message_out(INFO,"sanitize_proprietary_tags() (end of line) removed: "+string(buffer)); 00493 input_string.erase(orig_tag_open_idx,(crop_end_idx-orig_tag_open_idx)+1); 00494 } 00495 return input_string; 00496 } 00497 00498 00499 00505 string find_dtd(string dtd_filename) 00506 { 00507 int i; 00508 ifstream dtd_file; 00509 string dtd_path_filename; 00510 bool dtd_found=false; 00511 00512 for(i=0;i<DTD_SEARCH_PATH_NUM&&dtd_found==false;i++){ 00513 dtd_path_filename=DTD_SEARCH_PATH[i]; 00514 dtd_path_filename.append(dtd_filename); 00515 dtd_file.clear(); 00516 dtd_file.open(dtd_path_filename.c_str()); 00517 if(!dtd_file){ 00518 message_out(DEBUG,"find_dtd():Unable to open the file "+dtd_path_filename); 00519 } 00520 else{ 00521 message_out(STATUS,"find_dtd():DTD found: "+dtd_path_filename); 00522 dtd_file.close(); 00523 dtd_found=true; 00524 } 00525 } 00526 if(dtd_found==false){ 00527 message_out(ERROR,"find_dtd():Unable to find the DTD named " + dtd_filename); 00528 dtd_path_filename=""; 00529 } 00530 return dtd_path_filename; 00531 } 00532 00533
1.5.3