这是这个 SO question的后续问题。
现在从此处找到的演示链接库创建了模型结构,我现在想提取事实表信息。
模型结构为:
us-gaap_IncomeStatementAbstract
Statement [Table] us-gaap_StatementTable
Legal Entity [Axis] dei_LegalEntityAxis
Entity [Domain] dei_EntityDomain
Statement [Line Items] us-gaap_StatementLineItems
Net sales us-gaap_SalesRevenueNet
Cost of sales us-gaap_CostOfGoodsAndServicesSold
Gross margin us-gaap_GrossProfit
Operating expenses: us-gaap_OperatingExpensesAbstract
Research and development us-gaap_ResearchAndDevelopmentExpense
Selling, general and administrative us-gaap_SellingGeneralAndAdministrativeExpense
Total operating expenses us-gaap_OperatingExpenses
Operating income us-gaap_OperatingIncomeLoss
Other income/(expense), net us-gaap_NonoperatingIncomeExpense
Income before provision for income taxes us-gaap_IncomeLossFromContinuingOperationsBeforeIn...
Provision for income taxes us-gaap_IncomeTaxExpenseBenefit
Net income us-gaap_NetIncomeLoss
Earnings per share: us-gaap_EarningsPerShareAbstract
Basic us-gaap_EarningsPerShareBasic
Diluted us-gaap_EarningsPerShareDiluted
Shares used in computing earnings per share: us-gaap_WeightedAverageNumberOfSharesOutstandingAb...
Basic us-gaap_WeightedAverageNumberOfSharesOutstandingBa...
Diluted us-gaap_WeightedAverageNumberOfDilutedSharesOutsta...
Cash dividends declared per share us-gaap_CommonStockDividendsPerShareDeclared
我试图从 xml 文档重新创建的事实表包含以下信息:
然后可以呈现该事实表以生成该表:
问题是我不确定如何获取每个行项目的具体事实。例如,模型结构包含Net sales
具有概念的元素us-gaap_SalesRevenueNet
。实例文档包含以下引用us-gaap_SalesRevenueNet
:
contextRef decimals fact_value id_x tag unitRef {http://www.w3.org/1999/xlink}arcrole {http://www.w3.org/1999/xlink}href {http://www.w3.org/1999/xlink}type {http://www.w3.org/2001/XMLSchema-instance}nil cik_x cik_y id_y startDate endDate instant
471 eol_PE2035----1510-Q0015_STD_91_20141227_0 -6 74599000000 id_5473321_00DC1C18-22C7-426B-AF70-F6B281547EC4_2_0 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20141227_0 2014-09-28 2014-12-27
527 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1138497 -6 30566000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_1002_0 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1138497 2014-09-28 2014-12-27
529 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1173722 -6 5448000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_2002_6 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1173722 2014-09-28 2014-12-27
531 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1181338 -6 16144000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_3002_4 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1181338 2014-09-28 2014-12-27
533 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1184739 -6 17214000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_4002_2 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1184739 2014-09-28 2014-12-27
535 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1257623 -6 5227000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_5002_8 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1257623 2014-09-28 2014-12-27
628 eol_PE2035----1510-Q0015_STD_91_20151226_0 -6 75872000000 id_5473321_00DC1C18-22C7-426B-AF70-F6B281547EC4_1_0 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20151226_0 2015-09-27 2015-12-26
701 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1138497 -6 29325000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_1001_0 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1138497 2015-09-27 2015-12-26
703 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1173722 -6 4794000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_2001_6 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1173722 2015-09-27 2015-12-26
705 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1181338 -6 18373000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_3001_4 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1181338 2015-09-27 2015-12-26
707 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1184739 -6 17932000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_4001_2 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1184739 2015-09-27 2015-12-26
709 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1257623 -6 5448000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_5001_8 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1257623 2015-09-27 2015-12-26
在显示的 12 个事实中,事实表只需要两个 - 它们是 contextRef 为eol_PE2035----1510-Q0015_STD_91_20141227_0
和的事实eol_PE2035----1510-Q0015_STD_91_20151226_0
。
这些 contextRef id 对应于实例文档中的以下事实:
<context id="eol_PE2035----1510-Q0015_STD_91_20141227_0">
<entity>
<identifier scheme="http://www.sec.gov/CIK">0000320193</identifier>
</entity>
<period>
<startDate>2014-09-28</startDate>
<endDate>2014-12-27</endDate>
</period>
</context>
<context id="eol_PE2035----1510-Q0015_STD_91_20151226_0">
<entity>
<identifier scheme="http://www.sec.gov/CIK">0000320193</identifier>
</entity>
<period>
<startDate>2015-09-27</startDate>
<endDate>2015-12-26</endDate>
</period>
</context>
这些 contextRefs 本质上是Period Axis
元素。我无法判断周期轴是如何从 xml文档中确定的,因此无法重现事实表。谁能阐明如何做到这一点?