Changeset 2188 for libswish3/trunk/src/libswish3/parser.c
- Timestamp:
- 11/03/08 21:44:48 (2 months ago)
- Files:
-
- libswish3/trunk/src/libswish3/parser.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
libswish3/trunk/src/libswish3/parser.c
r2187 r2188 684 684 { 685 685 swish_ParserData *parser_data; 686 xmlChar *baked; 687 686 688 parser_data = (swish_ParserData *)data; 687 689 … … 705 707 push_tag_stack(parser_data->domstack, (xmlChar *)tag, parser_data->tag, SWISH_DOT); 706 708 } 707 709 708 710 /* 709 711 * set property if this tag is configured for it 710 712 */ 711 if (swish_hash_exists(parser_data->s3->config->properties, parser_data->tag)) { 713 if (swish_hash_exists(parser_data->s3->config->properties, parser_data->tag) 714 || 715 swish_hash_exists(parser_data->s3->config->properties, parser_data->domstack->head->context) 716 ) { 712 717 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) 713 718 SWISH_DEBUG_MSG(" %s = new property", parser_data->tag); … … 715 720 add_stack_to_prop_buf(NULL, parser_data); /* NULL means all properties in the stack are added */ 716 721 xmlBufferEmpty(parser_data->prop_buf); 717 718 push_tag_stack(parser_data->propstack, (xmlChar *)tag, parser_data->tag, SWISH_SPACE); 722 723 if (swish_hash_exists(parser_data->s3->config->properties, parser_data->domstack->head->context)) 724 baked = parser_data->domstack->head->context; 725 else 726 baked = parser_data->tag; 727 728 push_tag_stack(parser_data->propstack, (xmlChar *)tag, baked, SWISH_SPACE); 719 729 720 730 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) … … 725 735 * likewise for metastack 726 736 */ 727 if (swish_hash_exists(parser_data->s3->config->metanames, parser_data->tag)) { 737 if (swish_hash_exists(parser_data->s3->config->metanames, parser_data->tag) 738 || 739 swish_hash_exists(parser_data->s3->config->metanames, parser_data->domstack->head->context) 740 ) { 728 741 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) 729 742 SWISH_DEBUG_MSG(" %s = new metaname", parser_data->tag); … … 731 744 flush_buffer(parser_data, parser_data->metastack->head->baked, 732 745 parser_data->metastack->head->context); 733 734 push_tag_stack(parser_data->metastack, (xmlChar *)tag, parser_data->tag, SWISH_SPACE); 746 747 if (swish_hash_exists(parser_data->s3->config->properties, parser_data->domstack->head->context)) 748 baked = parser_data->domstack->head->context; 749 else 750 baked = parser_data->tag; 751 752 push_tag_stack(parser_data->metastack, (xmlChar *)tag, baked, SWISH_SPACE); 735 753 } 736 754 … … 1083 1101 ptr->domstack->temp = NULL; 1084 1102 ptr->domstack->count = 0; 1085 push_tag_stack(ptr->domstack, (xmlChar *)".", (xmlChar *)".", SWISH_DOT);1086 1087 /*1088 * no such property just to seed stack1089 */1090 1103 1091 1104 /* … … 2155 2168 tmp = swish_xmalloc(size); 2156 2169 2157 if (snprintf((char *)tmp, size, "%s%c%s", (char *)flat, flatten_join, (char *)stack->temp->baked) 2158 > 0) { 2170 if (snprintf((char *)tmp, size, "%s%c%s", 2171 (char *)stack->temp->baked, flatten_join, (char *)flat) 2172 > 0 2173 ) { 2159 2174 if (flat != NULL) 2160 2175 swish_xfree(flat); … … 2178 2193 { 2179 2194 swish_TagStack *stack; 2180 intcleanwsp;2195 boolean cleanwsp; 2181 2196 swish_Property *prop; 2182 2197
