function taxonomy_xml_get_literal_string in Taxonomy import/export via XML 6.2
Same name and namespace in other branches
- 5.2 rdf_format.inc \taxonomy_xml_get_literal_string()
- 5 rdf_format.inc \taxonomy_xml_get_literal_string()
- 6 rdf_format.inc \taxonomy_xml_get_literal_string()
- 7 taxonomy_xml.module \taxonomy_xml_get_literal_string()
Choose a string from an array of language-tagged possibilities
Util func to help read complex RDF statements.
1 call to taxonomy_xml_get_literal_string()
- taxonomy_xml_canonicize_predicates in ./
taxonomy_xml.module - Convert aliased predicates into common ones.
File
- ./
rdf_format.inc, line 846 - Include routines for RDF parsing and taxonomy/term creation. @author dman http://coders.co.nz
Code
function taxonomy_xml_get_literal_string($values) {
if (!is_array($values)) {
return trim($values);
}
// May need to choose language
if (count($values) == 1) {
$out = array_pop($values);
}
else {
// TODO add language selector
if ($label = @$values['en']) {
$out = $label;
}
else {
// fine, whatever
$out = array_pop($values);
}
}
return trim($out);
}