diff options
author | Dave Beckett <dave@dajobe.org> | 2001-08-15 22:53:45 +0000 |
---|---|---|
committer | Dave Beckett <dave@dajobe.org> | 2001-08-15 22:53:45 +0000 |
commit | 54aca50ef7d920cebae5c13772de0431de9198af (patch) | |
tree | 1c0f4b01d09f2749925f3d8e9330e6ea8cea9b83 | |
parent | a02318753309bcca0e60f47c057b9a71544d4183 (diff) | |
download | raptor-54aca50ef7d920cebae5c13772de0431de9198af.tar.gz |
(raptor_xml_start_element_handler): Process rdf: attributes on
document element.
(raptor_start_element_grammar): Handle <rdf:Description> at top level
when <rdf:RDF> not present.
-rw-r--r-- | src/raptor_general.c | 26 | ||||
-rw-r--r-- | src/raptor_parse.c | 26 | ||||
-rw-r--r-- | src/raptor_rdfxml.c | 26 |
3 files changed, 48 insertions, 30 deletions
diff --git a/src/raptor_general.c b/src/raptor_general.c index 90bb7c98..03eacff8 100644 --- a/src/raptor_general.c +++ b/src/raptor_general.c @@ -1401,8 +1401,8 @@ raptor_xml_start_element_handler(void *user_data, /* leave literal XML alone */ - if (rdf_parser->current_element && - rdf_parser->current_element->content_type != RAPTOR_ELEMENT_CONTENT_TYPE_LITERAL) { + if (!(rdf_parser->current_element && + rdf_parser->current_element->content_type == RAPTOR_ELEMENT_CONTENT_TYPE_LITERAL)) { /* Save pointers to some RDF M&S attributes */ @@ -3062,14 +3062,20 @@ raptor_start_element_grammar(raptor_parser *rdf_parser, case RAPTOR_STATE_UNKNOWN: /* found <rdf:RDF> ? */ - if(element_in_rdf_ns && - IS_RDF_MS_CONCEPT(el_name, element->name->uri, RDF)) { - element->child_state=RAPTOR_STATE_OBJ; - /* Yes - need more content before can continue, - * so wait for another element - */ - finished=1; - break; + if(element_in_rdf_ns) { + if(IS_RDF_MS_CONCEPT(el_name, element->name->uri, RDF)) { + element->child_state=RAPTOR_STATE_OBJ; + /* Yes - need more content before can continue, + * so wait for another element + */ + finished=1; + break; + } + if(IS_RDF_MS_CONCEPT(el_name, element->name->uri, Description)) { + state=RAPTOR_STATE_OBJ; + /* Yes - found something so move immediately to obj */ + break; + } } /* If scanning for element, can continue */ diff --git a/src/raptor_parse.c b/src/raptor_parse.c index 90bb7c98..03eacff8 100644 --- a/src/raptor_parse.c +++ b/src/raptor_parse.c @@ -1401,8 +1401,8 @@ raptor_xml_start_element_handler(void *user_data, /* leave literal XML alone */ - if (rdf_parser->current_element && - rdf_parser->current_element->content_type != RAPTOR_ELEMENT_CONTENT_TYPE_LITERAL) { + if (!(rdf_parser->current_element && + rdf_parser->current_element->content_type == RAPTOR_ELEMENT_CONTENT_TYPE_LITERAL)) { /* Save pointers to some RDF M&S attributes */ @@ -3062,14 +3062,20 @@ raptor_start_element_grammar(raptor_parser *rdf_parser, case RAPTOR_STATE_UNKNOWN: /* found <rdf:RDF> ? */ - if(element_in_rdf_ns && - IS_RDF_MS_CONCEPT(el_name, element->name->uri, RDF)) { - element->child_state=RAPTOR_STATE_OBJ; - /* Yes - need more content before can continue, - * so wait for another element - */ - finished=1; - break; + if(element_in_rdf_ns) { + if(IS_RDF_MS_CONCEPT(el_name, element->name->uri, RDF)) { + element->child_state=RAPTOR_STATE_OBJ; + /* Yes - need more content before can continue, + * so wait for another element + */ + finished=1; + break; + } + if(IS_RDF_MS_CONCEPT(el_name, element->name->uri, Description)) { + state=RAPTOR_STATE_OBJ; + /* Yes - found something so move immediately to obj */ + break; + } } /* If scanning for element, can continue */ diff --git a/src/raptor_rdfxml.c b/src/raptor_rdfxml.c index 90bb7c98..03eacff8 100644 --- a/src/raptor_rdfxml.c +++ b/src/raptor_rdfxml.c @@ -1401,8 +1401,8 @@ raptor_xml_start_element_handler(void *user_data, /* leave literal XML alone */ - if (rdf_parser->current_element && - rdf_parser->current_element->content_type != RAPTOR_ELEMENT_CONTENT_TYPE_LITERAL) { + if (!(rdf_parser->current_element && + rdf_parser->current_element->content_type == RAPTOR_ELEMENT_CONTENT_TYPE_LITERAL)) { /* Save pointers to some RDF M&S attributes */ @@ -3062,14 +3062,20 @@ raptor_start_element_grammar(raptor_parser *rdf_parser, case RAPTOR_STATE_UNKNOWN: /* found <rdf:RDF> ? */ - if(element_in_rdf_ns && - IS_RDF_MS_CONCEPT(el_name, element->name->uri, RDF)) { - element->child_state=RAPTOR_STATE_OBJ; - /* Yes - need more content before can continue, - * so wait for another element - */ - finished=1; - break; + if(element_in_rdf_ns) { + if(IS_RDF_MS_CONCEPT(el_name, element->name->uri, RDF)) { + element->child_state=RAPTOR_STATE_OBJ; + /* Yes - need more content before can continue, + * so wait for another element + */ + finished=1; + break; + } + if(IS_RDF_MS_CONCEPT(el_name, element->name->uri, Description)) { + state=RAPTOR_STATE_OBJ; + /* Yes - found something so move immediately to obj */ + break; + } } /* If scanning for element, can continue */ |