| 293 | } |
| 294 | |
| 295 | int xp_set_xml_buffer_from_string(const char *str) |
| 296 | { |
| 297 | size_t len = strlen(str); |
| 298 | |
| 299 | if (len > XP_MAX_FILE_LEN) { |
| 300 | return 0; |
| 301 | } |
| 302 | |
| 303 | strcpy(xp_file, str); |
| 304 | xp_stack = xp_stack_invalid_line = 0; |
| 305 | xp_history_reset(); |
| 306 | xp_position[xp_stack] = xp_file; |
| 307 | |
| 308 | if (!strstartswith(xp_position[xp_stack], "<?xml")) |
| 309 | return 0; |
| 310 | if (!strstr(xp_position[xp_stack], "?>")) |
| 311 | return 0; |
| 312 | xp_position[xp_stack] = xp_position[xp_stack] + 2; |
| 313 | |
| 314 | return 1; |
| 315 | } |
| 316 | |
| 317 | int xp_set_xml_buffer_from_file(const char *filename) |
| 318 | { |