/** * 12.2.4.34 */ static int h5_state_before_attribute_name(h5_state_t* hs) { int ch; TRACE(); ch = h5_skip_white(hs); switch (ch) { case CHAR_EOF: { return 0; } case CHAR_SLASH: { hs->pos += 1; return h5_state_self_closing_start_tag(hs); } case CHAR_GT: { hs->state = h5_state_data; hs->token_start = hs->s + hs->pos; hs->token_len = 1; hs->token_type = TAG_NAME_CLOSE; hs->pos += 1; return 1; } default: { return h5_state_attribute_name(hs); } } }
/** * 12.2.4.36 */ static int h5_state_after_attribute_name(h5_state_t* hs) { int c; TRACE(); c = h5_skip_white(hs); switch (c) { case CHAR_EOF: { return 0; } case CHAR_SLASH: { hs->pos += 1; return h5_state_self_closing_start_tag(hs); } case CHAR_EQUALS: { hs->pos += 1; return h5_state_before_attribute_value(hs); } case CHAR_GT: { return h5_state_tag_name_close(hs); } default: { return h5_state_attribute_name(hs); } } }
/** * 12.2.4.37 */ static int h5_state_before_attribute_value(h5_state_t* hs) { int c; TRACE(); c = h5_skip_white(hs); if (c == CHAR_EOF) { hs->state = h5_state_eof; return 0; } if (c == CHAR_DOUBLE) { return h5_state_attribute_value_double_quote(hs); } else if (c == CHAR_SINGLE) { return h5_state_attribute_value_single_quote(hs); } else { return h5_state_attribute_value_no_quote(hs); } }