XBRL Variable Specification 1.0
Public Working Draft, dated 2006-12-10
Copyright © 2006, XBRL International Inc., All Rights Reserved
This version:
Variables-PWD-2006-12-18.rtf
is NORMATIVE. All other versions and formats are non-normative.
Editors
Name	Contact	Affiliation	
Phillip Engel	Phillip.Engel@morganstanley.com 	Morgan Stanley	
Geoff Shuetrim	geoff@galexy.net	Galexy	
David vun Kannon	david.k.vunkannon@us.pwc.com 	PricewaterhouseCoopers LLP	
Contributors
			
Abstract
This specification is an extension of the XBRL 2.1 Specification [XBRL]. It defines syntax for declaration of two kinds of XBRL variables, ones that only evaluate to sequences of facts in an XBRL instance and ones that can evaluate to yield a broader range of values.
XBRL variables play an important role in extracting information from an XBRL instance or an XBRL Discoverable Taxonomy Set (DTS).  They can also be used to define constants and to define transformations of other variables.
Every XBRL variable implies an XPath expression.  This XPath expression is evaluated in the context of a single XBRL instance.
Status
This is an Public Working Draft whose circulation is unrestrictedcuments. Comments should be directed to the editor and/or contributors by e-mail.  Recipients of this draft are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.
In the final version of this document:
•	relevant schema extracts will be included in the text of the specification
•	relevant examples will be included
•	error codes will be included.
To reduce the editorial burden, these aspects of the specification have been omitted for internal working drafts.
Normative status
This document is normative in the sense that any implementing processor must obey the rules described within it, in order to be considered a conformant processor.
Table of contents
1.1	Document conventions (non-normative)
1.1.1	Typographic conventions
1.1.2	Formatting conventions
1.1.3	Namespace conventions (normative)
1.2	Relationship to other work
1.3	Language independence
1.4	Terminology
1.5	XPath usage
2	Introduction
3	Syntax
3.1	Fact variables
3.1.1	Filters
3.1.2	variable-filter relationships
3.2	The XPath expression implied by a fact variable
3.3	General variables
3.3.1	The XPath expression implied by a general variable
Appendices
A	References (Non Normative)
B	Normative schema

1.1	Document conventions (non-normative)
1.1.1	Typographic conventions
Comments which are informative, but not essential to the understanding of the point at hand are provided in footnotes. All footnotes are non-normative.
1.1.2	Formatting conventions
The following highlighting is used to present normative technical material in this document:
	
The following formatting is used for non-normative examples in this document:

The following formatting is used for non-normative counterexamples (examples of poor, discouraged or disallowed usage) in this document:

1.1.3	Namespace conventions (normative)
This table contains all the prefixes used within the text and the correspondent namespace URI. The prefix column in the table above is non normative. The namespace URI column is normative.
Prefix	Namespace URI	
xbrli	http://www.xbrl.org/2003/instance	
xl	http://www.xbrl.org/2003/XLink	
generic	http://xbrl.org/2007/generic	
variable	http://xbrl.org/2007/variable	
1.2	Relationship to other work
This specification depends upon XBRL 2.1 Specification Recommendation [XBRL].
In the event of any conflicts between this document and the XBRL 2.1 Specification, the XBRL 2.1 Specification prevails.
1.3	Language independence
The official language of XBRL International’s own work products is English and the preferred spelling convention is UK English.
1.4	Terminology
All terminology defined in the XBRL 2.1 Specification [XBRL] is used unchanged in this specification.
The following additional terms are used as described in the table below:
Term	Meaning (Normative)	
effective Boolean value	Effective Boolean value is defined in section 2.4.3 of the XPath 2.0 specification Error! Reference source not found..	
fact variable	A variable that only evaluates to a sequence of facts.	
filter	A test of the facts in a target instance.	
target fact	The target fact is the fact in the target instance that is being tested for binding to a variable.	
target instance	The target instance is the XBRL instance containing data that variables MAY evaluate to.	
general variable	A variable that can evaluate to any valid XPath sequence.	
variable	A general or fact variable.	
variable’s filter	A filter that is associated with a variable by a variable-filter relationship	
variable-filter relationship	A relationship from a variable to a filter, expressed by an XLink arc.	
XBRL extended link	An XBRL extended link is an XLink extended link that MAY be a part of an XBRL 2.1 DTS.	
XPath expression	Wherever an XPath expression is mentioned in this specification it refers to an XPath 2.0 expression.	

1.5	XPath usage
XPath usage is identical to that in the Formula 1.0 Specification [FORMULA].
2	Introduction
This specification is an extension of the XBRL 2.1 Specification [XBRL]. It defines syntax for declaration of two kinds of XBRL variables, ones that only evaluate to sequences of facts in an XBRL instance and ones that can evaluate to yield a broader range of values.
XBRL variables play an important role in extracting information from an XBRL instance or an XBRL Discoverable Taxonomy Set (DTS).  They can also be used to define constants and to define transformations of other variables.
Every XBRL variable implies an XPath expression.  This XPath expression is evaluated in the context of a single XBRL instance.
3	Syntax
This specification only provides a textual declaration of syntax constraints when those constraints are not expressed by the normative schema supplied with this specification.
Explanations of elements and attributes are only supplied when those explanations are not already provided in other specifications.
Syntax is defined for two types of variables: fact variables, which evaluate to sequences of facts in an XBRL instance; and general variables that are less constrained.  Both types of variables imply XPath expressions.  The XPath expressions for all variables, regardless of their type, MUST be evaluated using the xbrli:xbrl element of the target instance as the context node.
3.1	Fact variables
A fact variable is declared by a variable:factVariable element in an XBRL extended link.  Such an element is referred to as a fact variable.
The XPath expression implied by a fact variable depends on the filters that are related to the fact variable.
3.1.1	Filters
Filters express criteria that can be applied to facts in an XBRL instance.  Such criteria can be incorporated into the XPath expressions implied by variables.
Filters are declared as XLink resources in XLink extended links.  Filters MUST be in the substitution group for the xl:resource element.
Filters MUST imply an XPath expression that can be evaluated using any fact as a context node.
Every filter specification MUST include rules for constructing the XPath expression implied by that filter.
A fact does not meet the criteria specified by a filter if the result of evaluating the XPath expression implied by that filter is an XPath effective Boolean value of false.
The XPath expression implied by a filter MAY include XPath variables.  Resolution of such XPath variables is beyond the scope of this specification.
3.1.2	variable-filter relationships
The filters that define criteria to be included in the XPath expression implied by a fact variable are related to that fact variable by XLink arcs [XLink].  To declare a relationship between a fact variable and a filter, an XLink arc element MUST:
•	be a generic arc;
•	have an arcrole equal to http://xbrl.org/arcrole/variable-filter;
•	have the fact variable at the source of the arc; and
•	have the filter at the target of the arc.
Such relationships are referred to as variable-filter relationships.
Generic arcs are defined in the Generic Link 1.0 Specification [GENLINK].
3.2	The XPath expression implied by a fact variable
The XPath expression implied by a fact variable begins with:
xfi:facts-in-instance()
this term is then followed by zero or more XPath expressions, each in square brackets. There is one XPath expression in square brackets for each filter with an active variable-filter relationship to the variable. The XPath expression in the square brackets for a given filter is the XPath expression implied by that filter.
3.3	General variables
A general variable is declared by a variable:generalVariable element in an XBRL extended link.  Such elements are referred to as general variables.
3.3.1	The XPath expression implied by a general variable
The XPath expression implied by a general variable is the content of the select attribute on the general variable.
Appendices
A	References (Non Normative)

[FORMULA]	Phillip Engel, Geoff Shuetrim, David vun Kannon
XBRL Formula Specification 1.0
	
[GENLINK]	Mark Goodhand (editor)
Generic Links in XBRL, Internal Working Draft
	
[XBRL]	Phillip Engel, Walter Hamscher, Geoff Shuetrim, David vun Kannon and Hugh Wallis
Extensible Business Reporting Language 2.1 Recommendation with corrected Errata dated 2005-04-25
http://www.xbrl.org/Specification/XBRL-RECOMMENDATION-2003-12-31+Corrected-Errata-2005-04-25.rtf
	
[XLink]	Steve DeRose, Eve Maler, and David Orchard
XML Linking Language (XLink) Version 1.0
http://www.w3.org/TR/xlink
	
B	Normative schema
The following is the normative schema for this specification. 

<?xml version="1.0" encoding="UTF-8"?>
<schema 
  xmlns="http://www.w3.org/2001/XMLSchema" 
  targetNamespace="http://xbrl.org/2007/variable"
  xmlns:variable="http://xbrl.org/2007/variable"
  xmlns:expression="http://xbrl.org/2007/expression" 
  xmlns:generic="http://xbrl.org/2007/generic" 
  xmlns:link="http://www.xbrl.org/2003/linkbase" 
  xmlns:xl="http://www.xbrl.org/2003/XLink"
  elementFormDefault="qualified"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="
  http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd
  http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd
  ">

  <import namespace="http://www.xbrl.org/2003/XLink" 
    schemaLocation="http://www.xbrl.org/2003/xl-2003-12-31.xsd"/>

  <import namespace="http://xbrl.org/2007/expression" 
    schemaLocation="expression.xsd"/>

  <annotation>
    <appinfo>
      <link:arcroleType
        id="variable-filter" 
        cyclesAllowed="none" 
        arcroleURI="http://xbrl.org/arcrole/variable-filter">
        <link:definition>variable-filter</link:definition>
        <link:usedOn>generic:arc</link:usedOn>
      </link:arcroleType>
    </appinfo>
  </annotation>

  <element name="generalVariable">
    <complexType mixed="true">
      <complexContent mixed="true">
        <extension base="xl:resourceType">
          <attribute name="select" type="expression:expression" 
          use="required" />
          <anyAttribute namespace="http://www.w3.org/XML/1998/namespace"
          processContents="lax"/>
      </complexContent>
    </complexType>
  </element>

  <element name="factVariable" substitutionGroup="xl:resource">
    <complexType mixed="true">
      <complexContent mixed="true">
        <extension base="xl:resourceType">
          <anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="lax"/>
        </extension>
      </complexContent>
    </complexType>
  </element>

</schema>	
C	Intellectual Property Status (non-normative)
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to XBRL International or XBRL organizations, except as required to translate it into languages other than English. Members of XBRL International agree to grant certain licenses under the XBRL International Intellectual Property Policy (www.xbrl.org/legal).
This document and the information contained herein is provided on an "AS IS" basis and XBRL INTERNATIONAL DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
The attention of users of this document is directed to the possibility that compliance with or adoption of XBRL International specifications may require use of an invention covered by patent rights. XBRL International shall not be responsible for identifying patents for which a license may be required by any XBRL International specification, or for conducting legal inquiries into the legal validity or scope of those patents that are brought to its attention. XBRL International specifications are prospective and advisory only. Prospective users are responsible for protecting themselves against liability for infringement of patents. XBRL International takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Members of XBRL International agree to grant certain licenses under the XBRL International Intellectual Property Policy (www.xbrl.org/legal).
D	Acknowledgements (non-normative)
This document could not have been written without the contributions of many people including the participants in the XBRL Formula Working Group.
E	Document History (non-normative)
Date	Editor	Summary	
2006-12-18	Geoff Shuetrim	First internal working draft created, drawing extensively on the previous Formula specification drafts.	
2007-02-01	Hugh Wallis	Editorial to reflect Public Working Draft status