XBRL Concept Filter Specification 1.0
Public Working Draft, dated 2007-07-13
Copyright © 2006-7, XBRL International Inc., All Rights Reserved
This version:
Concept-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].  Specifically, it specifies syntax for filters that condition upon concept-level information such as the name of the concept, the period-type of the concept and the balance of the concept, if one is specified.
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	Concept-name filter declarations
3.2	Concept period-type filter declarations
3.3	Concept balance filter declarations
3.4	Concept custom attribute filter declarations
3.5	Concept data-type filter declarations
3.6	Concept substitution-group filter declarations
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	
filter	http://xbrl.org/2007/filter/concept	
1.2	Relationship to other work
This specification depends upon the XBRL 2.1 Specification [XBRL]. This specification depends upon XBRL Variables 1.0 Specification [VARIABLES].
In the event of any conflicts between this specification and the specifications upon which it depends, this specification does not prevail.
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)	
concept name filter	A filter expressed using the filter:conceptName element.	
		
1.5	XPath usage
XPath usage is identical to that in the XBRL Formula 1.0 Specification Error! Reference source not found..
2	Introduction
This specification is an extension to the XBRL Variables 1.0 Specification [VARIABLES].  Specifically, it specifies syntax for filters that condition upon concept-level information such as the name of the concept, the period-type of the concept and the balance of the concept, if one is specified.
In relation to implicit filtering, as defined in the XBRL Variables Specification [VARIABLES], all filters defined in this specification cover the concept aspect of facts.
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.
3.1	Concept-name filter declarations
A concept-name filter is declared by a filter:conceptName element in an XBRL extended link.
The syntax for the filter:conceptName element is defined by the normative schema supplied with this specification.
The concept-name filter can be used to match facts based upon the names of their concepts.
The XPath expression implied by a concept-name filter is determined by the QName value of the filter's child filter:name elements.
The XPath expression implied by a concept-name filter contains one term for each child name element of the concept name filter.
Each term will have one of two forms.  If the filter:name element contains a filter:qnameExpression element, then the term will have the form:
xfi:concept-substitutes-for(.,#qnameExpression) if the strict attribute on the filter:name element equals false; and
(fn:node-name(.)=#qnameExpression) if the strict attribute on the filter:name element equals true.
#qnameExpression is the XPath expression contained by the filter:qnameExpression element.
If the filter:name element contains a filter:qname element, then the term will have the form:
xfi:concept-substitutes-for(.,xs:QName(#namespace,#name)) if the strict attribute on the filter:name element equals false; and
(fn:node-name(.)=xs:QName(#namespace,#name)) if the strict attribute on the filter:name element equals true.
#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.
Use the XPath or operator to combine each of these terms to form the single XPath expression that is implied by the concept name filter.
Note: The xfi:concept-substitutes-for(.,xs:QName(#namespace,#name)) function returns true if the concept in the first parameter is in the substitution group for the concept identified by the QName in the second parameter.
3.2	Concept period-type filter declarations
A concept period-type filter is declared by a filter:conceptPeriodType element in an XBRL extended link.
The syntax for the filter:conceptPeriodType element is defined by the normative schema supplied with this specification.
The concept period-type filter can be used to match facts based upon whether they have duration type or instant type concepts, as determined by the xbrli:periodType attribute on the concept declarations.
The XPath expression implied by a concept period-type filter is obtained from:
xfi:period-type(xfi:concept(.)) = #periodType
3.3	Concept balance filter declarations
A concept balance filter is declared by a filter:conceptBalance element in an XBRL extended link.
The syntax for the filter:conceptBalance element is defined by the normative schema supplied with this specification.
The concept balance filter can be used to match facts based upon whether they have xbrli:balance attribute with a value of debit or credit on their concept declarations.
The XPath expression implied by a concept balance filter is obtained from:
xfi:balance(xfi:concept(.)) = #balance
3.4	Concept custom attribute filter declarations
A concept custom attribute filter is declared by a filter:conceptCustomAttribute element in an XBRL extended link.
The syntax for the filter:conceptCustomAttribute element is defined by the normative schema supplied with this specification.
The concept custom attribute filter can be used to match facts based upon the value of a custom attribute on their concept's declaration.
If the filter:attribute element contains a filter:qnameExpression element, then the implied XPath expression is obtained from:
xfi:custom-concept-attribute(.,#qnameExpression) = #value
where #qnameExpression is the XPath expression contained by the filter:qnameExpression element.
If the filter:attribute element contains a filter:qname element, then the implied XPath expression is obtained from:
xfi:custom-concept-attribute(.,xs:QName(#namespace,#name)) = #value
where #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.
The required value for the custom attribute is supplied by the XPath expression in the value attribute on the concept custom attribute filter.
3.5	Concept data-type filter declarations
A concept data-type filter is declared by a filter:conceptDataType element in an XBRL extended link.
The syntax for the filter:conceptDataType element is defined by the normative schema supplied with this specification.
The concept data-type filter can be used to match facts based upon its data type.
If the filter:conceptDataType element contains a filter:qnameExpression element, then the implied XPath expression is obtained from:
xfi:datatype-is-a-restriction-of(.,#qnameExpression) if the strict attribute on the filter:conceptDataType element equals false; and
xfi:datatype-is(.,#qnameExpression) if the strict attribute on the filter:conceptDataType element equals true.
#qnameExpression is the XPath expression contained by the filter:qnameExpression element.
If the filter:conceptDataType element contains a filter:qname element, then the implied XPath expression is obtained from:
xfi:datatype-is-a-restriction-of(.,xs:QName(#namespace,#name)) if the strict attribute on the filter:conceptDataType element equals false; and
xfi:datatype-is(.,xs:QName(#namespace,#name)) if the strict attribute on the filter:conceptDataType element equals true.
#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.
3.6	Concept substitution-group filter declarations
A concept substitution-group filter is declared by a filter:conceptSubstitutionGroup element in an XBRL extended link.
The syntax for the filter:conceptSubstitutionGroup element is defined by the normative schema supplied with this specification.
The concept substitution-group filter can be used to match facts based upon its substitution group.
If the filter:conceptSubstitutionGroup element contains a filter:qnameExpression element, then the implied XPath expression is obtained from:
xfi:is-in-substitution-group-for(.,#qnameExpression) if the strict attribute on the filter:conceptSubstitutionGroup element equals false; and
xfi:substitutes-directly-for(.,#qnameExpression) if the strict attribute on the filter:conceptSubstitutionGroup element equals true.
#qnameExpression is the XPath expression contained by the filter:qnameExpression element.
If the filter:conceptSubstitutionGroup element contains a filter:qname element, then the implied XPath expression is obtained from:
xfi:is-in-substitution-group-for(.,xs:QName(#namespace,#name)) if the strict attribute on the filter:conceptSubstitutionGroup element equals false; and
xfi:substitutes-directly-for(.,xs:QName(#namespace,#name)) if the strict attribute on the filter:conceptSubstitutionGroup element equals true.
#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.
Note: the xfi:substitutes-directly-for(.,.) function will need to only return true if the concept specified in the first parameter identifies the element declaration identified by the QName in the second parameter as its substitution group in its XML Schema declaration.  This distinguishes it from the xfi:is-in-substitution-group-for(.,.) function that returns true if the concept in the first parameter is in the substitution group for any element that is in the substitution group for the element specified by the QName in the second parameter.
Appendices
A	References (Non Normative)

[GENLINK]	Mark Goodhand, Ignacio Hernández-Ros, Geoff Shuetrim (editors)
XBRL Generic Links 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/	
[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/ 	
[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/	
[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 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/concept-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/concept"
  xmlns:cf="http://xbrl.org/2007/filter/period" 
  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="conceptName" substitutionGroup="xl:resource">
    <complexType mixed="true">
      <complexContent mixed="true">
        <extension base="xl:resourceType">
          <sequence minOccurs="1" maxOccurs="unbounded">
            <element name="name">
              <complexType>
                <choice>
                  <element name="qname" type="QName"/>
                  <element name="qnameExpression" type="expression:expression"/>
                </choice>
                <attribute name="strict" type="boolean" use="required"/>
              </complexType>
            </element>
          </sequence>
          <anyAttribute namespace="http://www.w3.org/XML/1998/namespace" 
            processContents="lax"/>
        </extension>
      </complexContent>
    </complexType>
  </element>
  
  <element name="conceptPeriodType" substitutionGroup="xl:resource">
    <complexType mixed="true">
      <complexContent mixed="true">
        <extension base="xl:resourceType">
          <attribute name="periodType">
            <simpleType>
              <restriction base="token">
                <enumeration value="instant"/>
                <enumeration value="duration"/>
              </restriction>            
            </simpleType>
          </attribute>
          <anyAttribute namespace="http://www.w3.org/XML/1998/namespace" 
            processContents="lax"/>
        </extension>
      </complexContent>
    </complexType>
  </element>
  
  <element name="conceptBalance" substitutionGroup="xl:resource">
    <complexType mixed="true">
      <complexContent mixed="true">
        <extension base="xl:resourceType">
          <attribute name="balance">
            <simpleType>
              <restriction base="token">
                <enumeration value="debit"/>
                <enumeration value="credit"/>
              </restriction>
            </simpleType>
          </attribute>
          <anyAttribute namespace="http://www.w3.org/XML/1998/namespace" 
            processContents="lax"/>
        </extension>
      </complexContent>
    </complexType>
  </element>

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

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

  <element name="conceptSubstitutionGroup" substitutionGroup="xl:resource">
    <complexType mixed="true">
      <complexContent mixed="true">
        <extension base="xl:resourceType">
          <choice>
            <element name="qname" type="QName"/>
            <element name="qnameExpression" type="expression:expression"/>
          </choice>
          <attribute name="strict" type="boolean" use="required"/>
          <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-04-23	Geoff Shuetrim	Fixed up the rules for determination of the implied XPath expression to prevent the filter from resulting in true for all facts.	
2007-04-24	Geoff Shuetrim	Changed the concept filter to the concept name filter and modified it to use child elements instead of XLink relationships to concepts.  Added a period type filter and a balance filter.	
2007-04-25	Geoff Shuetrim	Added a data type filter, a substitution group filter and a filter to test the values of other custom attributes on concept declarations.  These new concept filters are based on suggestions from Victor Morilla.	
2007-05-08	Geoff Shuetrim	Added clarification about the fact aspect covered by the filters defined in this specification.	
2007-05-29	Geoff Shuetrim	Changed the target namespace of the normative schema again.  Modified the QName specification syntax to allow both static and dynamic QName specifications.  Modified data type and substitution group filters to operate with and without analysis of XML Schema grammar models.  Enabled concept name filter to exploit XML Schema substitution group relationships.	
2007-06-11	Geoff Shuetrim	Fixed up the wording in relation to the content of the concept-name filter and its child name elements.	
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