XBRL Dimension Filters 1.0 Specification
Public Working Draft, dated 2007-07-13
Copyright © 2006-7, XBRL International Inc., All Rights Reserved
This version:
Dimension-Filters-PWD-2007-07-13.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	
Hugh Wallis	hughwallis@xbrl.org	XBRL International	
Contributors
Name	Contact	Affiliation	
Victor Morilla	victor.morilla@bde.es	Banco de España	
Abstract
This specification is an extension to the XBRL Variables 1.0 Specification [VARIABLES].  This specification defines filters that can be used to ensure that a variable only binds to facts meeting specified criteria in relation to dimension information as defined in the XBRL Dimensions 1.0 Specification [XDT].
The filters defined in this specification can condition on dimension information in both the target instance and in its supporting DTS.  Both typed and explicit dimensions can be used to filter facts in the target instance.
Status
This is a Public Working Draft whose circulation is unrestricted. 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	Explicit dimension filter
3.1.1	filter-member relationships
3.1.2	The implied XPath expression
3.2	Typed dimension filter
3.2.1	The implied XPath expression
3.3	Dimension member filter
Appendices
A	References (non-normative)
B	Normative schema
C	Intellectual Property Status (non-normative)
D	Acknowledgements (non-normative)
E	Document History (non-normative)
F	Approval process (non-normative)

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	
xs	http://www.w3.org/2001/XMLSchema	
xfi	http://www.xbrl.org/2005/function/instance	
fn	http://www.w3.org/2006/xpath-functions	
xlink	http://www.w3.org/1999/xlink	
link	http://www.xbrl.org/2003/linkbase	
xl	http://www.xbrl.org/2003/XLink	
generic	http://xbrl.org/2007/generic	
variable	http://xbrl.org/2007/variable	
xdt	http://xbrl.org/2005/xbrldt	
filter	http://xbrl.org/2007/filter/dimension	
1.2	Relationship to other work
This specification depends upon XBRL 2.1 Specification [XBRL]. This specification depends upon XBRL Variables 1.0 Specification [VARIABLES]. This specification depends upon XBRL Dimensions 1.0 Specification [XDT].
In the event of any conflicts between this specification and the specifications upon which it depends, this specification does not prevail.
This specification has dependencies on specific XBRL functions [XBRLFunc] that will need to be defined.
These functions will be required to test for equivalence between parts of contexts.  Equivalence tests will need to be possible for entity identifiers, segments, periods and scenarios.
The functions designs used in the construction of the implied XPath expression for match filters will need to be updated as the forms of the necessary XBRL functions are determined.
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] and the XBRL Variables 1.0 Specification [VARIABLES] is used unchanged in this specification.
The following additional terms are used as described in the table below:
Term	Meaning (Normative)	
supporting DTS	The discoverable taxonomy set that is discoverable from the target instance.	
association between a dimension and a concept	An association exists between a dimension and a concept if that concept's facts may be reported with values for that dimension.	
a fact's concept	The concept declaring the XML Schema content model for the fact.	
a concept's fact	A fact that is an instance of the concept.	
target XBRL instance	The XBRL instance against which a formula is being evaluated.	

1.5	XPath usage
XPath usage is identical to that in the XBRL Formula 1.0 Specification [FORMULA].
2	Introduction
This specification is an extension to the XBRL Variables 1.0 Specification [VARIABLES].  This specification defines filters that can be used to ensure that a variable only binds to facts meeting specified criteria in relation to dimension information as defined in the XBRL Dimensions 1.0 Specification [XDT].
The filters defined in this specification can condition on dimension information in both the target instance and in its supporting DTS.  Both typed and explicit dimensions can be used to filter facts in the target instance.
In relation to implicit filtering, as defined in the XBRL Variables Specification [VARIABLES], all filters defined in this specification cover dimension aspects.  If the dimension being filtered is associated with the segment of the context fact, then the filter covers the dimension identified by the filter's dimension attribute in the segment.  If the dimension being filtered is associated with the scenario of the context fact, then the filter covers the dimension identified by the filter's dimension attribute in the scenario.  All dimension filters have a dimension attribute.
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.
Where the value of an attribute is to be inserted into an XPath expression to define the XPath expression implied by a filter, that value will be referred to in the XPath expression using a # sign followed by the name of the attribute.  For example, if a filter provides an attribute called “name” and it is to be inserted into an XPath expression, the representation of the XPath expression in this specification might be:
	true and xfi:entity-matches(#name)
3.1	Explicit dimension filter
An explicit dimension filter supports selection of those facts in an XBRL instance that are reported with a value for a specified explicit dimension.
The value for the specified explicit dimension may be provided explicitly as part of a fact's context or it may be implied as a default value for the specified explicit dimension if that dimension is associated with the fact's concept and has a default value.
An explicit dimension filter is declared by a filter:explicitDimension element in an XBRL extended link.
The syntax for the filter:explicitDimension element is defined by the normative schema supplied with this specification.
An explicit dimension filter MAY be related to explicit dimension members.
3.1.1	filter-member relationships
filter-member relationships are expressed using XLink arcs [XLink].  To declare a filter-member relationship between an explicit dimension filter and a member of an explicit dimension, an XLink arc element MUST:
•	have an arcrole equal to http://xbrl.org/arcrole/filter-member;
•	have the explicit dimension filter at the source of the arc; and
•	have the explicit dimension member at the target of the arc.
3.1.2	The implied XPath expression
The XPath expression implied by an explicit dimension filter is determined by its filter:dimension element and its filter-member relationships.
If an explicit dimension filter has no filter member relationships, then its implied XPath expression is:
	xfi:has-dimension(.,#dimension)
where #dimension is the value of the filter:qnameExpression element if it is contained by the filter:dimension element and #dimension is given by xs:QName(#namespace, #name) if the filter:qname element is contained by the filter:dimension element.  #namespace is the namespace for the QName specified as the content of the filter:qname element and #name is the local name for the QName specified as the content of the filter:qname element.
If an explicit dimension filter has filter member relationships, the implied XPath expression restricts the allowed values for the specified explicit dimension by being constructed as follows:
For each relationship from an explicit dimension filter to an explicit dimension member,
the implied XPath expression will contain a term with the form:
	xfi:has-explicit-dimension-value(.,#dimension, #members)
where #dimension is determined as specified above. and #member is the QName of the explicit dimension member.
The complete implied XPath expression is obtained by combining these terms using the XPath or operator.
The xfi:has-explicit-dimension-value function returns true if and only if:
•	the fact in the first parameter has a concept that is associated with the explicit dimension identified by the QName supplied by the #dimension parameter; and
•	the fact in the first parameter has a context that contains a value for the specified explicit dimension or has a context that implies a default value for the specified explicit dimension; and
•	the dimension value reported for the fact identified by the first parameter and the dimension identified by the second parameter corresponds to at least one of the QNames in the sequence of QNames that is the third parameter, #members. In the context of the explicit-dimension filter, the value of the #members parameter is determined as the QNames of the dimension members that have filter-member relationships to the explicit-dimension filter.
3.2	Typed dimension filter
A typed dimension filter supports selection of those facts in an XBRL instance with a specific value for a specific typed dimension.
A typed dimension filter is declared by a filter:typedDimension element in an XBRL extended link.
The syntax for the filter:typedDimension element is defined by the normative schema supplied with this specification.
3.2.1	The implied XPath expression
The XPath expression implied by a typed dimension filter is determined by its dimension attribute and its test attribute, if one is supplied.
If the typed dimension filter does not contain a test attribute, then its implied XPath expression is given by:
	xfi:has-dimension(.,#dimension)
#dimension is determined as specified for explicit dimension filters.
Otherwise, the XPath expression implied by a typed dimension filter is:
xfi:has-dimension(.,#dimension) and 
xfi:dimension-value(.,#dimension)[#test]
The implied XPath expression returns true if and only if:
•	the fact's concept is associated with the typed dimension identified by the QName supplied by the dimension attribute; and
•	the fact that is the context node for evaluation of the implied XPath expression is reported with a context that contains a value for the specified typed dimension that meets the conditions specified by the test attribute.
3.3	Dimension member filter
A dimension member filter supports selection of those facts in an XBRL instance that are reported with one of a set of allowed values for a specified explicit dimension.  
An dimension member filter is declared by a filter:dimensionMember element in an XBRL extended link.
The syntax for the filter:dimensionMember element is defined by the normative schema supplied with this specification.
The XPath expression implied by a typed dimension filter is determined by its dimension element, its member element, its childrenOnly attribute, and its inclusive attribute.
If the member element is omitted, then all members for the dimension specified by the dimension attribute are selected.  The implied XPath expression is:
	xfi:has-dimension(.,#dimension) and
(for xfi:get-member-qnames(.,#dimension) as $dimension-value 
return xfi:has-dimension-value(.,#dimension,$dimension-value))
If the member element is supplied then the selected members only include the specified member itself if the inclusive attribute has a value of true.
If the member element is supplied, the inclusive attribute has a value of false or is omitted and the childrenOnly attribute has a value of true or is omitted, then the XPath expression implied by a dimension member filter is:
	xfi:has-dimension(.,#dimension) and
(for xfi:get-child-member-qnames(.,#dimension,#member) 
as $dimension-value 
return xfi:has-dimension-value(.,#dimension,$dimension-value))
If the member element is supplied, the inclusive attribute has a value of true and the childrenOnly attribute has a value of true or is omitted, then the XPath expression implied by a dimension member filter is:
	xfi:has-dimension(.,#dimension) and
(for (#member, xfi:get-child-member-qnames(.,#dimension,#member)) 
as $dimension-value 
return xfi:has-dimension-value(.,#dimension,$dimension-value))
If the member element is supplied, the inclusive attribute has a value of false or is omitted, and the childrenOnly attribute has a value of false, then the XPath expression implied by a dimension member filter is:
	xfi:has-dimension(.,#dimension) and
(for xfi:get-descendant-member-qnames(.,#dimension,#member) 
as $dimension-value 
return xfi:has-dimension-value(.,#dimension,$dimension-value))
If the member element is supplied, the inclusive attribute has a value of true and the childrenOnly attribute has a value of false, then the XPath expression implied by a dimension member filter is:
	xfi:has-dimension(.,#dimension) and
(for (#member, xfi:get-descendant-member-qnames(.,#dimension,#member)) 
as $dimension-value 
return xfi:has-dimension-value(.,#dimension,$dimension-value))
The xfi:get-member-qnames function returns a sequence of the QNames of the members (analysing networks of dimension-member relationships) of the dimension specified by the QName supplied for the function's single parameter.
The xfi:get-child-members function returns a sequence of the QNames of the child members (analysing networks of dimension-member relationships) of the dimension member that has its QName specified in the function's third argument.
The xfi:get-descendant-members function returns a sequence of the QNames of the dimensions members that are descendants (analysing networks of dimension-member relationships) of the dimension member that has its QName specified in the function's third argument.
In the implied XPath expressions, #dimension is the value of the filter:qnameExpression element if it is contained by the filter:dimension element and #dimension is given by xs:QName(#namespace, #name) if the filter:qname element is contained by the filter:dimension element.  #namespace is the namespace for the QName specified as the content of the filter:qname element and #name is the local name for the QName specified as the content of the filter:qname element.
In the implied XPath expressions, #member is the value of the filter:qnameExpression element if it is contained by the filter:member element and #member is given by xs:QName(#namespace, #name) if the filter:qname element is contained by the filter:member element.  #namespace is the namespace for the QName specified as the content of the filter:qname element and #name is the local name for the QName specified as the content of the filter:qname element.
Appendices
A	References (non-normative)
[FORMULA]	Phillip Engel, Geoff Shuetrim, David vun Kannon, Hugh Wallis (editors)
XBRL Formula Specification 1.0 Public Working Draft
http://www.xbrl.org/SpecPWDs/ 	
[VARIABLES]	Phillip Engel, Geoff Shuetrim, David vun Kannon, Hugh Wallis (editors)
XBRL Variables 1.0 Specification, Public Working Draft
http://www.xbrl.org/SpecPWDs/	
[XLink]	Steve DeRose, Eve Maler, and David Orchard
XML Linking Language (XLink) Version 1.0
http://www.w3.org/TR/xlink	
[XDT]	Ignacio Hernández-Ros, Hugh Wallis
XBRL Dimensions 1.0 Recommendation 
http://www.xbrl.org/SpecRecommendations/	
[XBRL]	Phillip Engel, Walter Hamscher, Geoff Shuetrim, David vun Kannon and Hugh Wallis
Extensible Business Reporting Language 2.1 Recommendation 
http://www.xbrl.org/SpecRecommendations/	
[XBRLFunc]	Chris Simmons (editor), Cliff Binstock, Phillip Engel, Herm Fischer, David vun Kannon, Hugh Wallis and Paul Warren
XBRL Functions 1.0 Public Working Draft
http://www.xbrl.org/SpecPWDs/	
B	Normative schema
The following is the XML schema provided as part of this specification. This is normative. Non-normative versions (which should be identical to these except for appropriate comments indicating their non-normative status) are also provided as separate files for convenience of users of the specification.
NOTE: (non-normative) Following the schema maintenance policy of XBRL International, it is the intent (but is not guaranteed) that the location of non-normative versions of these schemas on the web will be as follows:
1)	While any schema is the most current RECOMMENDED version and until it is superseded by any additional errata corrections a non-normative version will reside on the web in the directory http://www.xbrl.org/2007/ - during the drafting process for this specification this directory should contain a copy of the most recent published version of the schema at http://www.xbrl.org/2007/dimension-filter.xsd .
2)	A non-normative version of each schema as corrected by any update to the RECOMMENDATION will be archived in perpetuity on the web in a directory that will contain a unique identification indicating the date of the update. 

<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2007 XBRL International. All Rights Reserved. -->
<schema 
  targetNamespace="http://xbrl.org/2007/filter/dimension"
  xmlns:df="http://xbrl.org/2007/filter/dimension" 
  xmlns:generic="http://xbrl.org/2007/generic" 
  xmlns:expression="http://xbrl.org/2007/expression" 
  xmlns:link="http://www.xbrl.org/2003/linkbase" 
  xmlns:xl="http://www.xbrl.org/2003/XLink"
  elementFormDefault="qualified"
  xmlns="http://www.w3.org/2001/XMLSchema" 
  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"/>

  <element name="explicitDimension" substitutionGroup="xl:resource">
    <complexType mixed="true">
      <complexContent mixed="true">
        <extension base="xl:resourceType">
          <sequence>
            <element name="dimension">
              <complexType>
                <choice>
                  <element name="qname" type="QName"/>
                  <element name="qnameExpression" type="expression:expression"/>
                </choice>
              </complexType>
            </element>
          </sequence>
          <anyAttribute namespace="http://www.w3.org/XML/1998/namespace" 
            processContents="lax"/>
        </extension>
      </complexContent>
    </complexType>
  </element>

  <element name="typedDimension" substitutionGroup="xl:resource">
    <complexType mixed="true">
      <complexContent mixed="true">
        <extension base="xl:resourceType">
          <sequence>
            <element name="dimension">
              <complexType>
                <choice>
                  <element name="qname" type="QName"/>
                  <element name="qnameExpression" type="expression:expression"/>
                </choice>
              </complexType>
            </element>
          </sequence>
          <attribute name="test" type="expression:expression" use="optional"/>
          <anyAttribute namespace="http://www.w3.org/XML/1998/namespace" 
            processContents="lax"/>
        </extension>
      </complexContent>
    </complexType>
  </element>

  <element name="dimensionMember" substitutionGroup="xl:resource">
    <complexType mixed="true">
      <complexContent mixed="true">
        <extension base="xl:resourceType">
          <sequence>
            <element name="dimension">
              <complexType>
                <choice>
                  <element name="qname" type="QName"/>
                  <element name="qnameExpression" type="expression:expression"/>
                </choice>
              </complexType>
            </element>
            <element name="member">
              <complexType>
                <choice>
                  <element name="qname" type="QName"/>
                  <element name="qnameExpression" type="expression:expression"/>
                </choice>
              </complexType>
            </element>
          </sequence>
          <attribute name="childrenOnly" type="boolean" use="optional"/>
          <attribute name="inclusive" type="boolean" use="optional"/>
          <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	
2007-04-23	Geoff Shuetrim	First internal working draft created, drawing on the use cases provided by Victor Morilla.	
2007-05-03	Geoff Shuetrim	Incorporated feedback on the implied XPath expression designs from Victor Morilla.	
2007-05-08	Geoff Shuetrim	Added clarification about the fact aspect covered by the filters defined in this specification.	
2007-05-18	Geoff Shuetrim	Modified the dimension-member filter to include the inclusive Boolean attribute and to cover the case where the member attribute is omitted.  The changes were based on feedback on limitations of the filter identified in Herm Fischer's preparations for the Munich conference.	
2007-05-29	Geoff Shuetrim	Changed the target namespace of the normative schema again.  Made the QName specification capable of covering static and dynamic QNames.	
2007-06-04	Geoff Shuetrim	Simplified the implied XPath expression for filters on typed dimensions.	
2007-06-11	Geoff Shuetrim	Clarified the explanation of the functions required to support the implied XPath expression for the explicit-dimension filter.	
2007-06-25	Geoff Shuetrim	Modified the information about implicit filter implications of dimension filters to allow for implicit filtering at the individual dimension level.	
2007-07-24	Hugh Wallis	Editorial for Publication	
F	Approval process (non-normative)
This section will be removed from the final recommendation.
This specification is being developed following the XBRL Technical Working Group Processes: http://www.xbrl.org/XSB/XBRL_Technical_Working_Group_Processes-Approved-2007-04-17.htm