function taxonomy_xml_rdf_add_namespace in Taxonomy import/export via XML 6.2
Adding namespaces is fiddly.
4 calls to taxonomy_xml_rdf_add_namespace()
- geotaxonomy_taxonomy_xml_rdf_document_setup in includes/
taxonomy_xml.geotaxonomy.inc - Add the expected namespaces to the root of the document during construction.
- menu_taxonomy_xml_rdf_document_setup in includes/
taxonomy_xml.menu.inc - Add the expected namespaces to the root of the document during construction.
- path_taxonomy_xml_rdf_document_setup in includes/
taxonomy_xml.path.inc - Add the expected namespaces to the root of the document during construction.
- taxonomy_xml_rdf_document in ./
rdf_format.inc - Set up an RDF document preamble. Returns a document, also sets the passed handle to the RDF node that content should land in
File
- ./
rdf_format.inc, line 990 - Include routines for RDF parsing and taxonomy/term creation. @author dman http://coders.co.nz
Code
function taxonomy_xml_rdf_add_namespace($element, $uri, $prefix) {
// By appending a namespaced att, the extra namespaces appear at the top.
// Then remove them again, but don;t remove the namespace!
// Otherwise the appear everywhere. There must be a better way
$element
->setattributens($uri, "{$prefix}:hack", "Initializing namespace in PHP is hard");
$element
->removeattribute("{$prefix}:hack");
}