Skip to content

Extension taxonomies

bseddon edited this page Nov 12, 2016 · 5 revisions

When a taxonomy author needs to create a new taxonomy they always have the option to start from scratch. Another option is to extend and existing taxonomy. This project supports compiling and will automatically use an extension taxonomy if needed.

###Compiling

Compiling extension taxonomies is accomplished by calling the XBRL static function compileExtensionXSD.

This variant of the compile process first loads the extension taxonomy to interrogate the imported schemas. If any of their namespaces are found to have been added by an XBRL descendant class a base taxonomy is loaded. Then the extension taxonomy is loaded so any references by the extension taxonomy to components such as elements and hypercubes can be resolved. The function parameters are:

  • @param string $taxonomy_file The name of the taxonomy file (xsd) to load
  • @param string $namespace (optional) The namespace of the extension taxonomy to retrieve.
  • @param string $output_basename A name to use as the base for output files. 'xxx' will result in 'xxx.zip' and 'xxx.json' output files. If a name is not supplied, the basename of the schema file will be used.
  • @return boolean|XBRL <false, XBRL>
XBRL::compileExtensionXSD( 
	$taxonomy_file, 
	$namespace = null, 
	$output_basename = null 
);

###Loading

A special static function on the XBRL class called loadExtensionXSD is available to load a compiled extension taxonomy. This function will be called when the caller knows the XSD is an extension taxonomy. The function parameters are:

  • @param string $taxonomy_file The name of the taxonomy file (xsd) to load
  • @param string $namespace The namespace of the extension taxonomy.
  • @return boolean|XBRL The loaded taxonomy or or false
XBRL::loadExtensionXSD( 
	$taxonomy_file, 
	$namespace = null
)
Clone this wiki locally