taxplorer 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +14 -0
- data/.travis.yml +8 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +11 -0
- data/bin/taxplorer +4 -0
- data/data/taxonomies/uk-gaap/presentation/uk-aurep-2009-09-01-presentation.xml +133 -0
- data/data/taxonomies/uk-gaap/presentation/uk-bus-2009-09-01-presentation.xml +614 -0
- data/data/taxonomies/uk-gaap/presentation/uk-countries-2009-09-01-presentation.xml +552 -0
- data/data/taxonomies/uk-gaap/presentation/uk-currencies-2009-09-01-presentation.xml +388 -0
- data/data/taxonomies/uk-gaap/presentation/uk-direp-2009-09-01-presentation.xml +550 -0
- data/data/taxonomies/uk-gaap/presentation/uk-exchanges-2009-09-01-presentation.xml +381 -0
- data/data/taxonomies/uk-gaap/presentation/uk-gaap-2009-09-01-presentation.xml +11652 -0
- data/data/taxonomies/uk-gaap/presentation/uk-languages-2009-09-01-presentation.xml +222 -0
- data/data/taxonomies/uk-gaap/xsds/uk-aurep-2009-09-01.xsd +79 -0
- data/data/taxonomies/uk-gaap/xsds/uk-bus-2009-09-01.xsd +460 -0
- data/data/taxonomies/uk-gaap/xsds/uk-cd-ref-2009-09-01.xsd +62 -0
- data/data/taxonomies/uk-gaap/xsds/uk-common-2009-09-01.xsd +15 -0
- data/data/taxonomies/uk-gaap/xsds/uk-countries-2009-09-01.xsd +299 -0
- data/data/taxonomies/uk-gaap/xsds/uk-currencies-2009-09-01.xsd +215 -0
- data/data/taxonomies/uk-gaap/xsds/uk-direp-2009-09-01.xsd +348 -0
- data/data/taxonomies/uk-gaap/xsds/uk-exchanges-2009-09-01.xsd +209 -0
- data/data/taxonomies/uk-gaap/xsds/uk-gaap-2009-09-01.xsd +7283 -0
- data/data/taxonomies/uk-gaap/xsds/uk-gaap-ref-2009-09-01.xsd +32 -0
- data/data/taxonomies/uk-gaap/xsds/uk-languages-2009-09-01.xsd +134 -0
- data/data/taxonomies/uk-gaap/xsds/uk-types-2009-09-01.xsd +70 -0
- data/lib/taxplorer/command.rb +80 -0
- data/lib/taxplorer/find.rb +40 -0
- data/lib/taxplorer/parse.rb +95 -0
- data/lib/taxplorer/version.rb +3 -0
- data/lib/taxplorer/view.rb +23 -0
- data/lib/taxplorer.rb +29 -0
- data/taxplorer.gemspec +28 -0
- data/test/command_test.rb +6 -0
- data/test/find_test.rb +50 -0
- data/test/parse_test.rb +46 -0
- data/test/taxplorer_test.rb +19 -0
- data/test/test_helper.rb +4 -0
- data/test/view_test.rb +32 -0
- metadata +191 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!--
|
3
|
+
UK-GAAP-Reference-Schema
|
4
|
+
Copyright and other information - see http://www.xbrl.org/uk/legal.aspx
|
5
|
+
-->
|
6
|
+
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:uk-gaap-ref="http://www.xbrl.org/uk/all/gaap-ref/2009-09-01" targetNamespace="http://www.xbrl.org/uk/all/gaap-ref/2009-09-01" elementFormDefault="qualified" attributeFormDefault="unqualified">
|
7
|
+
<annotation>
|
8
|
+
<appinfo />
|
9
|
+
</annotation>
|
10
|
+
<import namespace="http://www.xbrl.org/2003/instance" schemaLocation="http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd" />
|
11
|
+
<import namespace="http://www.xbrl.org/2003/linkbase" schemaLocation="http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd" />
|
12
|
+
<element id="uk-gaap-ref_linkPart_Year" name="Year" type="string" substitutionGroup="link:part">
|
13
|
+
<annotation>
|
14
|
+
<documentation>Year in which reference material is published. Format is CCYY.</documentation>
|
15
|
+
</annotation>
|
16
|
+
</element>
|
17
|
+
<element id="uk-gaap-ref_linkPart_Abstract" name="Abstract" type="string" substitutionGroup="link:part">
|
18
|
+
<annotation>
|
19
|
+
<documentation>Used to represent rulings by organisations which release opinions in the form of Abstracts. The main UK example of such an organisation is the UITF.</documentation>
|
20
|
+
</annotation>
|
21
|
+
</element>
|
22
|
+
<element id="uk-gaap-ref_linkPart_Schedule" name="Schedule" type="string" substitutionGroup="link:part">
|
23
|
+
<annotation>
|
24
|
+
<documentation>Used to represent Schedules in legislation or other rulings. Main UK example is the Schedules in the Companies Act.</documentation>
|
25
|
+
</annotation>
|
26
|
+
</element>
|
27
|
+
<element id="uk-gaap-ref_linkPart_Part" name="Part" type="string" substitutionGroup="link:part">
|
28
|
+
<annotation>
|
29
|
+
<documentation>Used to represent items broken into Parts as well as other sections. A UK example is the Companies Act, whcih uses Schedule, Part, Paragraph, Sub-Paragraph as its main divisions.</documentation>
|
30
|
+
</annotation>
|
31
|
+
</element>
|
32
|
+
</schema>
|
@@ -0,0 +1,134 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!--
|
3
|
+
UK-Languages-Basic schema
|
4
|
+
Copyright and other information - see http://www.xbrl.org/uk/legal.aspx
|
5
|
+
-->
|
6
|
+
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:uk-lang="http://www.xbrl.org/uk/cd/languages/2009-09-01" xmlns:uk-types="http://www.xbrl.org/uk/all/types/2009-09-01" xmlns:xbrldt="http://xbrl.org/2005/xbrldt" targetNamespace="http://www.xbrl.org/uk/cd/languages/2009-09-01" elementFormDefault="qualified" attributeFormDefault="unqualified">
|
7
|
+
<annotation>
|
8
|
+
<appinfo>
|
9
|
+
<link:roleType roleURI="http://www.xbrl.org/uk/all/role/Languages" id="Languages">
|
10
|
+
<link:definition>97 - Languages</link:definition>
|
11
|
+
<link:usedOn>link:presentationLink</link:usedOn>
|
12
|
+
</link:roleType>
|
13
|
+
<link:roleType roleURI="http://www.xbrl.org/uk/all/role/Dimension-Languages" id="Dimension-Languages">
|
14
|
+
<link:definition>523 - Dimension - Languages</link:definition>
|
15
|
+
<link:usedOn>link:definitionLink</link:usedOn>
|
16
|
+
</link:roleType>
|
17
|
+
<link:linkbaseRef xlink:type="simple" xlink:href="uk-languages-2009-09-01-label.xml" xlink:role="http://www.xbrl.org/2003/role/labelLinkbaseRef" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:title="Label Links, all" />
|
18
|
+
<link:linkbaseRef xlink:type="simple" xlink:href="uk-languages-2009-09-01-reference.xml" xlink:role="http://www.xbrl.org/2003/role/referenceLinkbaseRef" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:title="Reference Links, all" />
|
19
|
+
<link:linkbaseRef xlink:type="simple" xlink:href="uk-languages-2009-09-01-definition.xml" xlink:role="http://www.xbrl.org/2003/role/definitionLinkbaseRef" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:title="Definition Links, all" />
|
20
|
+
</appinfo>
|
21
|
+
</annotation>
|
22
|
+
<import namespace="http://www.xbrl.org/2003/instance" schemaLocation="http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd" />
|
23
|
+
<import namespace="http://www.xbrl.org/uk/all/types/2009-09-01" schemaLocation="../../../all/types/2009-09-01/uk-types-2009-09-01.xsd" />
|
24
|
+
<import namespace="http://xbrl.org/2005/xbrldt" schemaLocation="http://www.xbrl.org/2005/xbrldt-2005.xsd" />
|
25
|
+
<import namespace="http://www.xbrl.org/uk/all/ref/2009-09-01" schemaLocation="../../../all/ref/2009-09-01/uk-cd-ref-2009-09-01.xsd" />
|
26
|
+
<import namespace="http://www.xbrl.org/uk/all/common/2009-09-01" schemaLocation="../../../all/common/2009-09-01/uk-common-2009-09-01.xsd" />
|
27
|
+
<import namespace="http://www.xbrl.org/2003/linkbase" schemaLocation="http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd" />
|
28
|
+
<element id="uk-lang_Abkhazian" name="Abkhazian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
29
|
+
<element id="uk-lang_Afrikaans" name="Afrikaans" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
30
|
+
<element id="uk-lang_Albanian" name="Albanian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
31
|
+
<element id="uk-lang_AllLanguages" name="AllLanguages" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
32
|
+
<element id="uk-lang_Amharic" name="Amharic" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
33
|
+
<element id="uk-lang_Arabic" name="Arabic" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
34
|
+
<element id="uk-lang_Armenian" name="Armenian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
35
|
+
<element id="uk-lang_Assamese" name="Assamese" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
36
|
+
<element id="uk-lang_Azerbaijani" name="Azerbaijani" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
37
|
+
<element id="uk-lang_Basque" name="Basque" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
38
|
+
<element id="uk-lang_Bengali" name="Bengali" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
39
|
+
<element id="uk-lang_Bihari" name="Bihari" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
40
|
+
<element id="uk-lang_Bulgarian" name="Bulgarian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
41
|
+
<element id="uk-lang_Burmese" name="Burmese" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
42
|
+
<element id="uk-lang_Byelorussian" name="Byelorussian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
43
|
+
<element id="uk-lang_Catalan" name="Catalan" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
44
|
+
<element id="uk-lang_Chinese" name="Chinese" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
45
|
+
<element id="uk-lang_Croatian" name="Croatian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
46
|
+
<element id="uk-lang_Czech" name="Czech" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
47
|
+
<element id="uk-lang_Danish" name="Danish" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
48
|
+
<element id="uk-lang_DimensionMembersRepresentingLanguagesHeading" name="DimensionMembersRepresentingLanguagesHeading" type="xbrli:stringItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
49
|
+
<element id="uk-lang_Dutch" name="Dutch" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
50
|
+
<element id="uk-lang_English" name="English" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
51
|
+
<element id="uk-lang_Esperanto" name="Esperanto" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
52
|
+
<element id="uk-lang_Estonian" name="Estonian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
53
|
+
<element id="uk-lang_Faroese" name="Faroese" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
54
|
+
<element id="uk-lang_Fijian" name="Fijian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
55
|
+
<element id="uk-lang_Finnish" name="Finnish" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
56
|
+
<element id="uk-lang_French" name="French" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
57
|
+
<element id="uk-lang_Frisian" name="Frisian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
58
|
+
<element id="uk-lang_Georgian" name="Georgian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
59
|
+
<element id="uk-lang_German" name="German" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
60
|
+
<element id="uk-lang_GreekModern" name="GreekModern" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
61
|
+
<element id="uk-lang_Greenlandic" name="Greenlandic" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
62
|
+
<element id="uk-lang_Gujarati" name="Gujarati" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
63
|
+
<element id="uk-lang_Hebrew" name="Hebrew" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
64
|
+
<element id="uk-lang_Hindi" name="Hindi" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
65
|
+
<element id="uk-lang_Icelandic" name="Icelandic" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
66
|
+
<element id="uk-lang_Indonesian" name="Indonesian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
67
|
+
<element id="uk-lang_Iranian" name="Iranian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
68
|
+
<element id="uk-lang_Irish" name="Irish" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
69
|
+
<element id="uk-lang_Italian" name="Italian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
70
|
+
<element id="uk-lang_Japanese" name="Japanese" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
71
|
+
<element id="uk-lang_Javanese" name="Javanese" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
72
|
+
<element id="uk-lang_Kashmiri" name="Kashmiri" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
73
|
+
<element id="uk-lang_Kazakh" name="Kazakh" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
74
|
+
<element id="uk-lang_Khmer" name="Khmer" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
75
|
+
<element id="uk-lang_Kirghiz" name="Kirghiz" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
76
|
+
<element id="uk-lang_Korean" name="Korean" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
77
|
+
<element id="uk-lang_Kurdish" name="Kurdish" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
78
|
+
<element id="uk-lang_LanguageListHeading" name="LanguageListHeading" type="xbrli:stringItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
79
|
+
<element id="uk-lang_LanguagesDimension" name="LanguagesDimension" type="xbrli:stringItemType" substitutionGroup="xbrldt:dimensionItem" xbrli:periodType="duration" abstract="true" nillable="true" />
|
80
|
+
<element id="uk-lang_Lao" name="Lao" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
81
|
+
<element id="uk-lang_Latin" name="Latin" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
82
|
+
<element id="uk-lang_Latvian" name="Latvian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
83
|
+
<element id="uk-lang_Letzeburgesch" name="Letzeburgesch" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
84
|
+
<element id="uk-lang_Lithuanian" name="Lithuanian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
85
|
+
<element id="uk-lang_Macedonian" name="Macedonian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
86
|
+
<element id="uk-lang_Malagasy" name="Malagasy" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
87
|
+
<element id="uk-lang_Malay" name="Malay" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
88
|
+
<element id="uk-lang_Maltese" name="Maltese" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
89
|
+
<element id="uk-lang_Maori" name="Maori" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
90
|
+
<element id="uk-lang_Marathi" name="Marathi" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
91
|
+
<element id="uk-lang_Moldavian" name="Moldavian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
92
|
+
<element id="uk-lang_Mongolian" name="Mongolian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
93
|
+
<element id="uk-lang_NauruLanguage" name="NauruLanguage" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
94
|
+
<element id="uk-lang_Nepali" name="Nepali" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
95
|
+
<element id="uk-lang_Norwegian" name="Norwegian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
96
|
+
<element id="uk-lang_Ossetic" name="Ossetic" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
97
|
+
<element id="uk-lang_Panjabi" name="Panjabi" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
98
|
+
<element id="uk-lang_Persian" name="Persian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
99
|
+
<element id="uk-lang_Polish" name="Polish" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
100
|
+
<element id="uk-lang_Portuguese" name="Portuguese" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
101
|
+
<element id="uk-lang_Pushto" name="Pushto" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
102
|
+
<element id="uk-lang_Quechua" name="Quechua" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
103
|
+
<element id="uk-lang_Rajasthani" name="Rajasthani" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
104
|
+
<element id="uk-lang_Romanian" name="Romanian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
105
|
+
<element id="uk-lang_Russian" name="Russian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
106
|
+
<element id="uk-lang_Samoan" name="Samoan" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
107
|
+
<element id="uk-lang_Serbian" name="Serbian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
108
|
+
<element id="uk-lang_Serbo-Croatian" name="Serbo-Croatian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
109
|
+
<element id="uk-lang_Singhalese" name="Singhalese" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
110
|
+
<element id="uk-lang_Slovak" name="Slovak" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
111
|
+
<element id="uk-lang_Slovenian" name="Slovenian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
112
|
+
<element id="uk-lang_Somali" name="Somali" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
113
|
+
<element id="uk-lang_Spanish" name="Spanish" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
114
|
+
<element id="uk-lang_Sudanese" name="Sudanese" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
115
|
+
<element id="uk-lang_Swahili" name="Swahili" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
116
|
+
<element id="uk-lang_Swazi" name="Swazi" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
117
|
+
<element id="uk-lang_Swedish" name="Swedish" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
118
|
+
<element id="uk-lang_Syriac" name="Syriac" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
119
|
+
<element id="uk-lang_Tagalog" name="Tagalog" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
120
|
+
<element id="uk-lang_Tahitian" name="Tahitian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
121
|
+
<element id="uk-lang_Tajik" name="Tajik" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
122
|
+
<element id="uk-lang_Tamil" name="Tamil" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
123
|
+
<element id="uk-lang_Thai" name="Thai" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
124
|
+
<element id="uk-lang_Tibetan" name="Tibetan" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
125
|
+
<element id="uk-lang_Turkish" name="Turkish" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
126
|
+
<element id="uk-lang_Turkmen" name="Turkmen" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
127
|
+
<element id="uk-lang_Ukrainian" name="Ukrainian" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
128
|
+
<element id="uk-lang_Urdu" name="Urdu" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
129
|
+
<element id="uk-lang_Uzbek" name="Uzbek" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
130
|
+
<element id="uk-lang_Vietnamese" name="Vietnamese" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
131
|
+
<element id="uk-lang_Welsh" name="Welsh" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
132
|
+
<element id="uk-lang_Yiddish" name="Yiddish" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
133
|
+
<element id="uk-lang_Zulu" name="Zulu" type="uk-types:domainItemType" substitutionGroup="xbrli:item" xbrli:periodType="duration" abstract="true" nillable="true" />
|
134
|
+
</schema>
|
@@ -0,0 +1,70 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!--
|
3
|
+
UK-Datatypes-Schema
|
4
|
+
Copyright and other information - see http://www.xbrl.org/uk/legal.aspx
|
5
|
+
-->
|
6
|
+
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:uk-types="http://www.xbrl.org/uk/all/types/2009-09-01" targetNamespace="http://www.xbrl.org/uk/all/types/2009-09-01" elementFormDefault="qualified" attributeFormDefault="unqualified">
|
7
|
+
<annotation>
|
8
|
+
<appinfo />
|
9
|
+
</annotation>
|
10
|
+
<import namespace="http://www.xbrl.org/2003/instance" schemaLocation="http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd" />
|
11
|
+
<complexType name="entityAccountsTypeItemType">
|
12
|
+
<simpleContent>
|
13
|
+
<restriction base="xbrli:stringItemType">
|
14
|
+
<enumeration value="Group consolidated accounts" />
|
15
|
+
<enumeration value="Company accounts" />
|
16
|
+
<enumeration value="Group consolidated and company accounts" />
|
17
|
+
<enumeration value="Other accounts type" />
|
18
|
+
</restriction>
|
19
|
+
</simpleContent>
|
20
|
+
</complexType>
|
21
|
+
<complexType name="percentItemType">
|
22
|
+
<simpleContent>
|
23
|
+
<restriction base="xbrli:pureItemType" />
|
24
|
+
</simpleContent>
|
25
|
+
</complexType>
|
26
|
+
<complexType name="reportPeriodItemType">
|
27
|
+
<simpleContent>
|
28
|
+
<restriction base="xbrli:tokenItemType">
|
29
|
+
<enumeration value="FY" />
|
30
|
+
<enumeration value="Q1" />
|
31
|
+
<enumeration value="Q2" />
|
32
|
+
<enumeration value="Q3" />
|
33
|
+
<enumeration value="Q4" />
|
34
|
+
<enumeration value="H1" />
|
35
|
+
<enumeration value="H2" />
|
36
|
+
<enumeration value="CY" />
|
37
|
+
<enumeration value="Other" />
|
38
|
+
</restriction>
|
39
|
+
</simpleContent>
|
40
|
+
</complexType>
|
41
|
+
<complexType name="entityFormItemType">
|
42
|
+
<simpleContent>
|
43
|
+
<restriction base="xbrli:stringItemType">
|
44
|
+
<enumeration value="Public Limited Company" />
|
45
|
+
<enumeration value="Private Limited Company" />
|
46
|
+
<enumeration value="Limited Liability Partnership" />
|
47
|
+
<enumeration value="Other" />
|
48
|
+
</restriction>
|
49
|
+
</simpleContent>
|
50
|
+
</complexType>
|
51
|
+
<complexType name="fixedItemType">
|
52
|
+
<simpleContent>
|
53
|
+
<restriction base="xbrli:stringItemType">
|
54
|
+
<length fixed="true" value="0" />
|
55
|
+
</restriction>
|
56
|
+
</simpleContent>
|
57
|
+
</complexType>
|
58
|
+
<complexType name="domainItemType">
|
59
|
+
<simpleContent>
|
60
|
+
<restriction base="xbrli:stringItemType">
|
61
|
+
<length fixed="true" value="0" />
|
62
|
+
</restriction>
|
63
|
+
</simpleContent>
|
64
|
+
</complexType>
|
65
|
+
<complexType name="perShareItemType">
|
66
|
+
<simpleContent>
|
67
|
+
<restriction base="xbrli:decimalItemType" />
|
68
|
+
</simpleContent>
|
69
|
+
</complexType>
|
70
|
+
</schema>
|
@@ -0,0 +1,80 @@
|
|
1
|
+
module Taxplorer
|
2
|
+
module Command
|
3
|
+
|
4
|
+
def load_shell
|
5
|
+
loop do
|
6
|
+
welcome_prompt
|
7
|
+
break if @run == false
|
8
|
+
end
|
9
|
+
puts "bye bye"
|
10
|
+
end
|
11
|
+
|
12
|
+
def welcome_prompt
|
13
|
+
choose do |menu|
|
14
|
+
menu.prompt = "Choose preferred taxonomy"
|
15
|
+
["Uk GAAP", "UK IFRS"].each do |t|
|
16
|
+
menu.choice(t) { |c| say("have a glass of whiskey while we load up #{c} for you"); load_taxonomy }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def menu_prompt
|
22
|
+
clear
|
23
|
+
choose do |menu|
|
24
|
+
menu.prompt = "Choose Taxonomy section"
|
25
|
+
get_sections.each do |s|
|
26
|
+
menu.choice(s) { |s| section_prompt(s)}
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def section_prompt(section_name)
|
32
|
+
clear
|
33
|
+
choose do |menu|
|
34
|
+
menu.prompt = "Choose Heading"
|
35
|
+
get_section(section_name).each do |s|
|
36
|
+
menu.choice(s[:label]) { |s| node_commands(s)}
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def child_nodes_prompt(nodes)
|
42
|
+
choose do |menu|
|
43
|
+
menu.prompt = "Select node"
|
44
|
+
nodes.each do |s|
|
45
|
+
menu.choice(s[:label]) { |s| node_commands(s)}
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def node_commands(node)
|
51
|
+
puts "Viewing #{node}"
|
52
|
+
cmd = ask("Enter command: ", %w{info children parent menu tree quit}) {|q| q.readline = true}
|
53
|
+
case cmd
|
54
|
+
when "info"
|
55
|
+
get_info(node)
|
56
|
+
when "children"
|
57
|
+
get_children(node)
|
58
|
+
when "parent"
|
59
|
+
get_parent(node)
|
60
|
+
when "menu"
|
61
|
+
menu_prompt
|
62
|
+
when "tree"
|
63
|
+
clear
|
64
|
+
tree_view(node)
|
65
|
+
puts "\n\n"
|
66
|
+
node_commands(node)
|
67
|
+
when "quit"
|
68
|
+
quit
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def quit
|
73
|
+
@run = false
|
74
|
+
end
|
75
|
+
|
76
|
+
def clear
|
77
|
+
system "clear" or system "cls"
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Taxplorer
|
2
|
+
module Find
|
3
|
+
|
4
|
+
def get_sections
|
5
|
+
@records["sections"].map {|s| s[:name]}
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_section(section_name)
|
9
|
+
@section = @records["sections"].find {|s| s[:name] == section_name}
|
10
|
+
@section[:elements].values.select {|e| e.parent == nil}
|
11
|
+
end
|
12
|
+
|
13
|
+
def get_info(node_label)
|
14
|
+
info = @records["elements"].find {|s| s[:id] == node_label}
|
15
|
+
puts Hirb::Helpers::AutoTable.render(info[:details])
|
16
|
+
node_commands(node_label)
|
17
|
+
end
|
18
|
+
|
19
|
+
def get_parent(node)
|
20
|
+
child = @section[:elements].values.find {|e| e[:label] == node}
|
21
|
+
parent = @section[:elements].values.find {|p| p[:label] == child[:parent]} if child
|
22
|
+
if parent
|
23
|
+
node_commands(parent[:label])
|
24
|
+
else
|
25
|
+
menu_prompt
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def get_children(node_id)
|
30
|
+
node = @section[:elements].values.find {|e| e[:label] == node_id}
|
31
|
+
nodes = @section[:elements].values.select {|e| e[:parent] == node_id}
|
32
|
+
if nodes.any?
|
33
|
+
child_nodes_prompt(nodes)
|
34
|
+
else
|
35
|
+
puts "no children"
|
36
|
+
node_commands(node_id)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
module Taxplorer
|
2
|
+
module Parse
|
3
|
+
|
4
|
+
Node = Struct.new(:label, :parent, :copies)
|
5
|
+
|
6
|
+
@@pinwheel = %w{ | / - \\ }
|
7
|
+
|
8
|
+
def load_taxonomy
|
9
|
+
parse_taxonomy_files
|
10
|
+
parse_presentation_files
|
11
|
+
menu_prompt
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def parse_taxonomy_files
|
17
|
+
Dir.glob("data/taxonomies/uk-gaap/**/*.xsd") do |file|
|
18
|
+
parsed_file = Nokogiri::XML(File.open(file))
|
19
|
+
add_sections(parsed_file)
|
20
|
+
add_elements(parsed_file)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def parse_presentation_files
|
25
|
+
Dir.glob("data/taxonomies/uk-gaap/presentation**/*.xml") do |file|
|
26
|
+
create_tree(Nokogiri::XML(File.open(file)))
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def add_sections(parsed_file)
|
31
|
+
roles = parsed_file.xpath("//link:roleType")
|
32
|
+
roles.each_with_index do |role, index|
|
33
|
+
if role.xpath("link:usedOn").text == "link:presentationLink"
|
34
|
+
@records["sections"] << {name: role.xpath("link:definition").text, role_uri: role.attributes["roleURI"].value, elements: Hash.new}
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def add_elements(parsed_file)
|
40
|
+
elements = parsed_file.search("element")
|
41
|
+
elements.each_with_index do |element, i|
|
42
|
+
id = element.attributes["id"] ? element.attributes["id"].value : nil
|
43
|
+
@records["elements"] << {id: id, details: add_details(element)}
|
44
|
+
STDOUT.write "\rAdding elements #{percentage(i, elements)}% " + @@pinwheel.rotate!.first
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def create_tree(parsed_file)
|
49
|
+
parsed_file.search('presentationLink').each do |p_link|
|
50
|
+
section = @records["sections"].find {|s| s[:role_uri] == p_link.attributes["role"].value}
|
51
|
+
add_nodes(section, p_link) if section
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def add_nodes(section, p_link)
|
56
|
+
nodes = p_link.search('loc, presentationArc')
|
57
|
+
nodes.each_with_index do |node, i|
|
58
|
+
if node.name == "loc"
|
59
|
+
create_node(section[:elements], node)
|
60
|
+
elsif node.name == "presentationArc"
|
61
|
+
upsert_node(section[:elements], node)
|
62
|
+
end
|
63
|
+
STDOUT.write "\rBuilding #{p_link.attributes["role"].value} tree #{percentage(i, nodes)}% " + @@pinwheel.rotate!.first
|
64
|
+
end
|
65
|
+
clear
|
66
|
+
end
|
67
|
+
|
68
|
+
def add_details(element)
|
69
|
+
info = {}
|
70
|
+
element.attributes.each do |key, value|
|
71
|
+
info[key] = value.value
|
72
|
+
end
|
73
|
+
info
|
74
|
+
end
|
75
|
+
|
76
|
+
def create_node(elements, loc)
|
77
|
+
node = Node.new(loc.attributes["label"].value, nil, 1)
|
78
|
+
elements[node.label] ||= node
|
79
|
+
end
|
80
|
+
|
81
|
+
def upsert_node(elements, arc)
|
82
|
+
node = elements[arc.attributes["to"].value]
|
83
|
+
if node and node.parent
|
84
|
+
node.copies += 1
|
85
|
+
elements[node.label + "-#{node.copies}"] = Node.new(arc.attributes["to"].value, arc.attributes["from"].value)
|
86
|
+
else
|
87
|
+
node.parent = arc.attributes["from"].value
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
def percentage(index, elements)
|
92
|
+
(index.to_f / elements.length * 100).to_i
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Taxplorer
|
2
|
+
module View
|
3
|
+
|
4
|
+
def table_view(node)
|
5
|
+
if node[:details]
|
6
|
+
puts Hirb::Helpers::AutoTable.render(info[:details])
|
7
|
+
else
|
8
|
+
puts "no information"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def tree_view(node, links="")
|
13
|
+
children = @section[:elements].values.select {|e| e[:parent] == node}
|
14
|
+
puts links + node
|
15
|
+
links = links + " "
|
16
|
+
children.map do |child|
|
17
|
+
tree_view(child[:label], links)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
|
data/lib/taxplorer.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "nokogiri"
|
4
|
+
require "taxplorer/command"
|
5
|
+
require "taxplorer/parse"
|
6
|
+
require "taxplorer/find"
|
7
|
+
require "taxplorer/view"
|
8
|
+
require 'hirb'
|
9
|
+
require 'highline/import'
|
10
|
+
|
11
|
+
class Application
|
12
|
+
include Taxplorer::Command
|
13
|
+
include Taxplorer::Parse
|
14
|
+
include Taxplorer::Find
|
15
|
+
include Taxplorer::View
|
16
|
+
|
17
|
+
attr_reader :records, :run
|
18
|
+
|
19
|
+
def initialize
|
20
|
+
@records ||= Hash.new
|
21
|
+
@records["sections"] ||= []
|
22
|
+
@records["elements"] ||= []
|
23
|
+
@run = true
|
24
|
+
load_shell
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
|
data/taxplorer.gemspec
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'taxplorer/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "taxplorer"
|
8
|
+
spec.version = Taxplorer::VERSION
|
9
|
+
spec.authors = ["Seosamh Cahill"]
|
10
|
+
spec.email = ["seo.cahill@gmail.com"]
|
11
|
+
spec.summary = %q{XBRL taxonomy parser}
|
12
|
+
spec.description = %q{View Taxonomy stuff.}
|
13
|
+
spec.homepage = "https://github.com/seocahill/taxplorer"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = ["taxplorer"]
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_development_dependency "minitest", "~> 5.6.1"
|
24
|
+
spec.add_development_dependency "coveralls"
|
25
|
+
spec.add_runtime_dependency "nokogiri", "~> 1.6.6"
|
26
|
+
spec.add_runtime_dependency "hirb", "~> 0.7.3"
|
27
|
+
spec.add_runtime_dependency "highline", "~> 1.7.2"
|
28
|
+
end
|
data/test/find_test.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'taxplorer'
|
3
|
+
|
4
|
+
class TestFind < Minitest::Test
|
5
|
+
@@taxonomy_file = Nokogiri::XML(File.open('data/taxonomies/uk-gaap/xsds/uk-aurep-2009-09-01.xsd'))
|
6
|
+
@@presentation_file = Nokogiri::XML(File.open('data/taxonomies/uk-gaap/presentation/uk-aurep-2009-09-01-presentation.xml'))
|
7
|
+
|
8
|
+
def setup
|
9
|
+
@mockapp = Class.new do
|
10
|
+
include Taxplorer::Parse
|
11
|
+
include Taxplorer::Find
|
12
|
+
attr_reader :records
|
13
|
+
def initialize;@records = {"sections" => [], "elements" => []};end
|
14
|
+
def clear;end
|
15
|
+
def node_commands(node);"command";end
|
16
|
+
def menu_prompt;"menu";end
|
17
|
+
def child_nodes_prompt(nodes);"child_prompt";end
|
18
|
+
end.new
|
19
|
+
@mockapp.send(:add_sections, @@taxonomy_file)
|
20
|
+
@mockapp.send(:add_elements, @@taxonomy_file)
|
21
|
+
@mockapp.send(:create_tree, @@presentation_file)
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_get_sections
|
25
|
+
assert_equal @mockapp.get_sections, ["06 - Auditor's Report"]
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_get_section
|
29
|
+
section = @mockapp.get_section("06 - Auditor's Report")
|
30
|
+
assert_equal section.length, 3
|
31
|
+
assert_equal section.first[:label], "uk-aurep_AuditorInformationHeading"
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_get_parent
|
35
|
+
@mockapp.get_section("06 - Auditor's Report")
|
36
|
+
assert_equal @mockapp.get_parent("uk-aurep_DateAuditorsReport"), "command"
|
37
|
+
assert_equal @mockapp.get_parent("uk-aurep_AuditorInformationHeading"), "menu"
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_get_children
|
41
|
+
@mockapp.get_section("06 - Auditor's Report")
|
42
|
+
assert_equal @mockapp.get_children("uk-aurep_DateAuditorsReport"), "command"
|
43
|
+
assert_equal @mockapp.get_children("uk-aurep_AuditorInformationHeading"), "child_prompt"
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_get_info
|
47
|
+
assert_output(/xbrli:dateItemType/){ @mockapp.get_info("uk-aurep_DateAuditorsReport") }
|
48
|
+
assert_equal @mockapp.get_info("uk-aurep_DateAuditorsReport"), "command"
|
49
|
+
end
|
50
|
+
end
|