Tuesday, January 18, 2011

BUG: Facts From Non-Target Namespaces Not Available from Loaded XBRL Document Object Model in Jan 2011 CTP

XBRL documents that use facts originating from multiple namespaces can be loaded into Gepsio, but not all of the facts will appear in the object model in the Jan 2011 CTP.

Consider, for example, an XBRL document whose schema declares the following namespaces:

Sample XBRL Schema
  1. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ci-com="http://xbrl.us/stm/ci/com/2008-03-31" xmlns:ci-scf-dir="http://xbrl.us/stm/ci/scf-dir/2008-03-31" xmlns:ci-scf-indir="http://xbrl.us/stm/ci/scf-indir/2008-03-31" xmlns:ci-sfp-cls="http://xbrl.us/stm/ci/sfp-cls/2008-03-31" xmlns:ci-sheci="http://xbrl.us/stm/ci/sheci/2008-03-31" xmlns:ci-soc="http://xbrl.us/stm/ci/soc/2008-03-31" xmlns:ci-soi="http://xbrl.us/stm/ci/soi/2008-03-31" xmlns:ci-spc="http://xbrl.us/stm/ci/spc/2008-03-31" xmlns:cmi="http://www.fujitsu.com/xbrl/taxeditor/default" xmlns:dei="http://xbrl.us/dei/2008-03-31" xmlns:dei-std="http://xbrl.us/dei-std/2008-03-31" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:ref="http://www.xbrl.org/2006/ref" xmlns:stm-all-ci="http://xbrl.us/ci/stm-all/2008-03-31" xmlns:stm-ci="http://xbrl.us/ci/stm/2008-03-31" xmlns:us-gaap="http://xbrl.us/us-gaap/2008-03-31" xmlns:us-gaap-all="http://xbrl.us/us-gaap-all/2008-03-31" xmlns:us-gaap-std="http://xbrl.us/us-gaap-std/2008-03-31" xmlns:us-roles="http://xbrl.us/us-roles/2008-03-31" xmlns:us-types="http://xbrl.us/us-types/2008-03-31" xmlns:xbrldt="http://xbrl.org/2005/xbrldt" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:xl="http://www.xbrl.org/2003/XLink" xmlns:xlink="http://www.w3.org/1999/xlink" elementFormDefault="qualified" targetNamespace="http://www.fujitsu.com/xbrl/taxeditor/default">

The target namespace in this example is http://www.fujitsu.com/xbrl/taxeditor/default, and the prefix for this namespace is cmi. Using the Gepsio Jan 2011 CTP, only facts in the cmi namespace will be loaded and available in the Facts collection. Facts in other namespaces will not appear in the collection.

Why is this happening?

When looking for facts in an XBRL document, Gepsio must determine which XML elements are indeed facts and which are elements defined in the XBRL specification (such as <context> and <period>). In the Jan 2011 CTP (and, indeed, all of the CTPs to this point), this determination is made by examining the current XML element’s namespace. If the namespace of the element matches the target namespace of the document’s schema, then the element is assumed to be a fact. Elements that are not a part of the target namespace are assumed to be something other than an XBRL fact, so they are not read in as a fact and not available in the Fact collection.

To continue the example using the sample XBRL schema shown above, only facts in the cmi namespace will be read in as an XBRL fact. Other elements in other namespaces, though they are facts, will not be read in as a fact and will not appear in the Fact collection. Facts using the us-gaap namespace, for example, will not appear in the Fact collection, even though they are indeed valid XBRL facts.

How will this be fixed in the future?

Gepsio’s fact loader will change in the future. Rather than looking at an XML element’s namespace to see if it matches the schema’s target namespace, the namespace URI for the XML element will be examined. If the namespace of the element lists the www.xbrl.org or www.w3.org domain, then the element will assumed to be something other than an XBRL fact. Elements using any other namespace domain will be assumed to be an XBRL fact. This rework should allow for a more complete population of a XbrlFragment object’s Fact collection.

When will this be fixed?

I am working on this bug now and am hoping to have this issue resolved in the Feb 2011 CTP.

1 comment:

  1. In working with XBRL instance files I easily find all facts - uniformly they have an attribute "contextRef" - (or a child does in the case of tuples).

    ReplyDelete