private function getFactDetails( $variableSet, $types, $fact )
	{
		$factHash = spl_object_hash( $fact );

		if ( ! isset( $this->factCache[ $factHash ] ) )
		{
			// Record the QName and other cache information if not defined
			if ( ! isset( $this->factQNameCache[ $factHash ] ) )
			{
				// Look up the namespace to find the schema prefix
				$factNamespace = $fact->getNamespaceURI();
				if ( ! isset( $this->factNamespaceCache[ $factNamespace ] ) )
				{
					$factTaxonomy = $variableSet->xbrlTaxonomy->getTaxonomyForNamespace( $fact->getNamespaceURI() );
					// Record the mapping
					$this->factNamespaceCache[ $factNamespace ] = $factTaxonomy->getPrefix();
				}
				// Retrieve the prefix to create a QName
				$factPrefix = $this->factNamespaceCache[ $factNamespace ];
				$factQName = new QName( $factPrefix, $fact->getNamespaceURI(), $fact->getLocalName() );

				// And record it against the fact hash
				$this->factQNameCache[ $factHash ] = $factQName;
				// If there is no element cached for the QName get it can record it
				if ( ! isset( $this->factElementCache[ $factQName->clarkNotation() ] ) )
				{
					$this->factElementCache[ $factQName->clarkNotation() ] = $types->getElement( $factQName->localName, $factQName->prefix );
				}
			}

			$factQName = $this->factQNameCache[ $factHash ];

			if ( ! isset( $this->factComponentsCache[ $factHash ] ) )
			{
				$this->factComponentsCache[ $factHash ] = $this->getFactComponents( $variableSet, $fact );
			}

			$factComponents = $this->factComponentsCache[ $factHash ];
			$factComponents['factHash'] = $factHash;
			$factComponents['qname'] = $factQName;
			$factComponents['fact'] = $fact;

			$this->factCache[ $factHash ] = $factComponents;
		}

		return $this->factCache[ $factHash ];
	}