-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
Next to not handling comments it also does not recognize processing instructions.
An easy way to overcome this is to use a do while loop in the node parsing like so:
//Need a do while loop to find a proper top tag and allow skipping of processing instructions or comments
do
{
/* Parse open tag
*/
tag_open = xml_parse_tag_open(parser);
if (!tag_open)
{
xml_parser_error(parser, NO_CHARACTER, "xml_parse_node::tag_open");
goto exit_failure;
}
original_length = tag_open->length;
attributes = xml_find_attributes(parser, tag_open);
//Check if the tag is a processing instruction or a comment
if((tag_open->length > 0) && ('?' == tag_open->buffer[0]) || (('!' == tag_open->buffer[0]) && ('-' == tag_open->buffer[1]) && ('-' == tag_open->buffer[2])))
{
//Drop the found processing instruction or comment
xml_string_free(tag_open);
//Reset the tag_open pointer to force scanning for the next one
tag_open = 0;
if(attributes)
{
//Need to free attributes!!!!!! also in error handling!!!!!
}
}
} while(!tag_open);
Another issue is the freeing of the attributes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels