function taxonomy_xml_rdf_add_vocab in Taxonomy import/export via XML 7
Create a vocabulary definition (just the def, not its terms) and insert it into the given document element.
No return, it acts on the DOM document directly.
Parameters
DOMElement $domcontainer: Modified by ref.
object $vocabulary: A vocab object.
1 call to taxonomy_xml_rdf_add_vocab()
- taxonomy_xml_rdf_create in formats/
rdf_format.inc - Return an XML/RDF document representing this vocab
File
- formats/
rdf_format.inc, line 736
Code
function taxonomy_xml_rdf_add_vocab(DOMElement &$domcontainer, $vocabulary) {
$dom = $domcontainer->ownerDocument;
$ns = rdf_get_namespaces();
// Describe the vocabulary itself.
$vocabnode = rdf_entity_to_xml($vocabulary, $dom, $domcontainer);
if (!$vocabnode) {
trigger_error("Failed to create vocabnode using XML methods", E_USER_ERROR);
return;
}
// If this was a cannonic vocab,
// we would use a full external URI as identifiers.
// But if it's our own, we get our own vocabulary path as a URI (or URN).
$vocabnode
->setattributens($ns['rdf'], 'rdf:about', taxonomy_xml_get_vocabulary_uri($vocabulary));
$vocabnode
->appendchild($dom
->createelementns($ns['owl'], 'owl:versionInfo', xmlentities(format_date(REQUEST_TIME, 'long'))));
}