diff --git a/Makefile b/Makefile index 876254f..48a587b 100644 --- a/Makefile +++ b/Makefile @@ -28,4 +28,5 @@ test: .PHONY: external include generate/iso/currency/include.mk +include generate/xbrl/instance/2003/include.mk external: $(EXTERNAL) diff --git a/external/xbrl/instance/2003/2003-12-13.xsd b/external/xbrl/instance/2003/2003-12-13.xsd new file mode 100644 index 0000000..f8c13bc --- /dev/null +++ b/external/xbrl/instance/2003/2003-12-13.xsd @@ -0,0 +1,779 @@ + + + + + + + Taxonomy schema for XBRL. This schema defines syntax relating to + XBRL instances. + + + + + + + + Define the attributes to be used on XBRL concept definitions + + + + + + + The periodType attribute (restricting the period for XBRL items) + + + + + + + + + + + + + + The balance attribute (imposes calculation relationship restrictions) + + + + + + + + + + + + + Define the simple types used as a base for for item types + + + + + + + the monetary type serves as the datatype for those financial + concepts in a taxonomy which denote units in a currency. + Instance items with this type must have a unit of measure + from the ISO 4217 namespace of currencies. + + + + + + + + + This datatype serves as the datatype for share based + financial concepts. + + + + + + + + + This datatype serves as the type for dimensionless numbers + such as percentage change, growth rates, and other ratios + where the numerator and denominator have the same units. + + + + + + + + + As the name implies this is a decimal value that can not take + the value 0 - it is used as the type for the denominator of a + fractionItemType. + + + + + + + + + + + + + + + + + + + + This type is used to specify the value of the + precision attribute on numeric items. It consists + of the union of nonNegativeInteger and "INF" (used + to signify infinite precision or "exact value"). + + + + + + + + + + + + + + + This type is used to specify the value of the decimals attribute + on numeric items. It consists of the union of integer and "INF" + (used to signify that a number is expressed to an infinite number + of decimal places or "exact value"). + + + + + + + + + + + + + + + Attributes for all items and tuples. + + + + + + + + + + Group of attributes for tuples. + + + + + + + + + Attributes for all items. + + + + + + + + + + Attributes for all numeric items (fractional and non-fractional). + + + + + + + + + + Group of attributes for non-fractional numeric items + + + + + + + + + + + Group of attributes for non-numeric items + + + + + + + + General numeric item types - for use on concept element definitions + The following 3 numeric types are all based on the built-in + data types of XML Schema. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + XBRL domain numeric item types - for use on concept element definitions + The following 4 numeric types are all types that have been identified as + having particular relevance to the domain space addressed by XBRL and are + hence included in addition to the built-in types from XML Schema. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The following 13 numeric types are all based on the XML Schema + built-in types that are derived by restriction from decimal. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The following 17 non-numeric types are all based on the primitive built-in + data types of XML Schema. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The following 5 non-numeric types are all based on the XML Schema + built-in types that are derived by restriction and/or list from string. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + XML Schema components contributing to the context element + + + + + + + + + + + + + + + The type for the entity element, used to describe the reporting entity. + Note that the scheme attribute is required and cannot be empty. + + + + + + + + + + + + + + + + + + + + + + + + + + The union of the date and dateTime simple types. + + + + + + + + + The type for the period element, used to describe the reporting date info. + + + + + + + + + + + + + + + + + + Used for the scenario under which fact have been reported. + + + + + + + + + + + Used for an island of context to which facts can be related. + + + + + + + + + + + + + + + XML Schema components contributing to the unit element + + + + + + + + + A collection of sibling measure elements + + + + + + + + + + + Element used to represent division in units + + + + + + + + + + + + + + Element used to represent units information about numeric items + + + + + + + + + + + + + + Elements to use for facts in instances + + + + + + + Abstract item element used as head of item substitution group + + + + + + + + Abstract tuple element used as head of tuple substitution group + + + + + + + + XBRL instance root element. + + + + + + + + + + + + + + + + + + + + + + diff --git a/generate/xbrl/instance/2003/include.mk b/generate/xbrl/instance/2003/include.mk new file mode 100644 index 0000000..f07b5af --- /dev/null +++ b/generate/xbrl/instance/2003/include.mk @@ -0,0 +1,14 @@ +BASE_URL_XBRL_2003 = http://www.xbrl.org/2003 + +.PHONY: external/xbrl/instance/2003/2003-12-13.xsd +external/xbrl/instance/2003/2003-12-13.xsd: scripts/fetch.py + $(PYTHON) $< "$(BASE_URL_XBRL_2003)/xbrl-instance-2003-12-31.xsd" $@ + +build/xbrl/instance/2003/%.json: scripts/xml2json.py external/xbrl/instance/2003/%.xsd + $(PYTHON) $< $(word 2,$^) $@ + +external-xbrl-instance-2003: generate/xbrl/instance/2003/main.py \ + build/xbrl/instance/2003/2003-12-13.json + $(PYTHON) $< + +EXTERNAL += external-xbrl-instance-2003 diff --git a/generate/xbrl/instance/2003/main.py b/generate/xbrl/instance/2003/main.py new file mode 100644 index 0000000..e69de29