You are here

function path_taxonomy_xml_rdf_export_term in Taxonomy import/export via XML 6.2

Add path information to the export document.

Only exports real aliases, doesn't bother with system term/{tid} paths.

Produce something like:

<rdfs:Class rdf:ID="term-35631" drupal:path="news/weather">

HOOK_taxonomy_xml_rdf_export_term

Parameters

$termnode The context to add attributes to, an XML term element,: already partially built. Modified by reference

$term The term being exported:

File

includes/taxonomy_xml.path.inc, line 22
Support for importing or exporting path data along with terms

Code

function path_taxonomy_xml_rdf_export_term($termnode, $term) {
  $dom = $termnode->nodeType == XML_DOCUMENT_NODE ? $termnode : $termnode->ownerDocument;

  // Path generally isn't loaded directly on a $term object,
  // but a term object may still have a path alias in the system.
  $path = '';
  $system_path = taxonomy_term_path($term);
  $found_path = drupal_get_path_alias($system_path);
  if ($found_path != $system_path) {

    // Found an alias
    $path = $found_path;
  }
  if ($path) {
    $termnode
      ->setattributens(TAXONOMY_XML_DRUPAL_NS, 'drupal:path', $path);
  }
}