Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
(raptor_sax2_inscope_xml_language): Allow returning ""
  • Loading branch information
dajobe committed Jun 10, 2012
1 parent 94029e7 commit a2fad4f
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/raptor_sax2.c
Expand Up @@ -319,8 +319,12 @@ raptor_xml_element_is_empty(raptor_xml_element* xml_element)
* @sax2: SAX2 object * @sax2: SAX2 object
* *
* Get the in-scope XML language * Get the in-scope XML language
*
* The result is a language string which may be "" if xml:lang="" is
* given. NULL is returned only if there is no xml:lang in any outer
* scope.
* *
* Return value: the XML language or NULL if none is in scope. * Return value: shared pointer to the XML language or NULL if none is in scope.
*/ */
const unsigned char* const unsigned char*
raptor_sax2_inscope_xml_language(raptor_sax2 *sax2) raptor_sax2_inscope_xml_language(raptor_sax2 *sax2)
Expand All @@ -329,14 +333,11 @@ raptor_sax2_inscope_xml_language(raptor_sax2 *sax2)


for(xml_element = sax2->current_element; for(xml_element = sax2->current_element;
xml_element; xml_element;
xml_element = xml_element->parent) xml_element = xml_element->parent) {
if(xml_element->xml_language) { if(xml_element->xml_language)
if(!*xml_element->xml_language)
return NULL;
return xml_element->xml_language; return xml_element->xml_language;
} }



return NULL; return NULL;
} }


Expand Down

0 comments on commit a2fad4f

Please sign in to comment.