【发布时间】:2016-03-18 15:07:13
【问题描述】:
我正在尝试解析 SEC edgar xml 数据,但对可链接的定义感到困惑。以下是他们的 10-Q 的 apple 定义链接库的摘录。注意:roleURI 列是从定义链接库中的roleRef 元素添加的。
idx order role {http://www.w3.org/1999/xlink}arcrole {http://www.w3.org/1999/xlink}from roleURI {http://www.w3.org/1999/xlink}to
16 1 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/dimension-domain dei_LegalEntityAxis aapl-20151226.xsd#Role_StatementOfIncome dei_EntityDomain
33 1 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/hypercube-dimension us-gaap_StatementTable aapl-20151226.xsd#Role_StatementOfIncome dei_LegalEntityAxis
17 1.01 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_OperatingExpensesAbstract aapl-20151226.xsd#Role_StatementOfIncome us-gaap_ResearchAndDevelopmentExpense
18 1.02 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_OperatingExpensesAbstract aapl-20151226.xsd#Role_StatementOfIncome us-gaap_SellingGeneralAndAdministrativeExpense
19 1.03 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_OperatingExpensesAbstract aapl-20151226.xsd#Role_StatementOfIncome us-gaap_OperatingExpenses
14 1.04 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_EarningsPerShareAbstract aapl-20151226.xsd#Role_StatementOfIncome us-gaap_EarningsPerShareBasic
15 1.05 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_EarningsPerShareAbstract aapl-20151226.xsd#Role_StatementOfIncome us-gaap_EarningsPerShareDiluted
21 1.06 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_StatementLineItems aapl-20151226.xsd#Role_StatementOfIncome us-gaap_SalesRevenueNet
22 1.07 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_StatementLineItems aapl-20151226.xsd#Role_StatementOfIncome us-gaap_CostOfGoodsAndServicesSold
23 1.08 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_StatementLineItems aapl-20151226.xsd#Role_StatementOfIncome us-gaap_GrossProfit
24 1.09 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_StatementLineItems aapl-20151226.xsd#Role_StatementOfIncome us-gaap_OperatingExpensesAbstract
25 1.1 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_StatementLineItems aapl-20151226.xsd#Role_StatementOfIncome us-gaap_OperatingIncomeLoss
26 1.11 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_StatementLineItems aapl-20151226.xsd#Role_StatementOfIncome us-gaap_NonoperatingIncomeExpense
27 1.12 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_StatementLineItems aapl-20151226.xsd#Role_StatementOfIncome us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest
28 1.13 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_StatementLineItems aapl-20151226.xsd#Role_StatementOfIncome us-gaap_IncomeTaxExpenseBenefit
29 1.14 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_StatementLineItems aapl-20151226.xsd#Role_StatementOfIncome us-gaap_NetIncomeLoss
30 1.15 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_StatementLineItems aapl-20151226.xsd#Role_StatementOfIncome us-gaap_EarningsPerShareAbstract
31 1.16 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_StatementLineItems aapl-20151226.xsd#Role_StatementOfIncome us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract
32 1.17 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_StatementLineItems aapl-20151226.xsd#Role_StatementOfIncome us-gaap_CommonStockDividendsPerShareDeclared
34 1.19 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract aapl-20151226.xsd#Role_StatementOfIncome us-gaap_WeightedAverageNumberOfSharesOutstandingBasic
35 1.2 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/domain-member us-gaap_WeightedAverageNumberOfSharesOutstandingAbstract aapl-20151226.xsd#Role_StatementOfIncome us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding
20 100 http://www.apple.com/taxonomy/role/StatementOfIncome http://xbrl.org/int/dim/arcrole/all us-gaap_StatementLineItems aapl-20151226.xsd#Role_StatementOfIncome us-gaap_StatementTable
根据这些数据,我希望能够为Condensed Consolidated Statements of Operations 重新创建here 呈现的格式。
我的问题是我不确定如何解析它。我假设一个从arcrole/all 开始,其中状态有一个来自链接=us-gaap_StatementLineItems 和到=us-gaap_StatementTable。从这一点可以通过表格追踪以下链接:
from to
us-gaap_StatementTable dei_LegalEntityAxis
dei_LegalEntityAxis dei_EntityDomain
从这里开始,它会停止,因为dei_EntityDomain 没有链接到任何东西。我知道结构应该是这样的:
渲染数据:
模型结构:
我希望链接库的结构看起来像这样:
from to
us-gaap_StatementTable dei_LegalEntityAxis
us-gaap_StatementTable us-gaap_StatementLineItems
我可以看到这将有效地允许从 Statement 表挂起两个级别,但它显然不是那样工作的。
谁能告诉我如何使用提供的定义链接库数据来读取它以达到上图所示的预期结构。一旦我了解了定义链接库的工作原理,我就可以提取事实和概念。
【问题讨论】:
-
这很复杂,我建议使用第 3 方 XBRL 处理器,而不是尝试自己做。 specification 解释了一切。
标签: xml-parsing xbrl edgar