Question

I'm trying to extract some data points from an XBRL file, using an XPath expression in Talend Studio. I want to extract all the ShareHolderFunds values and the end date for the period it relates to (referenced by the "ContextRef" attribute), along with the the company registered number. I'm struggling making the link to the period end date - at the moment my code incorrectly returns the same end date for both ShareHolderFund values.

Here's a screenshot of my code Talend Studio:

Talend Studio

And here's an extract of the XBRL:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://www.companieshouse.gov.uk/ef/xbrl/uk/fr/gaap/ae/2009-06-21/stylesheet/CH-AE-stylesheet.xsl"?>
<xbrl xmlns="http://www.xbrl.org/2003/instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ae="http://www.companieshouse.gov.uk/ef/xbrl/uk/fr/gaap/ae/2009-06-21" xmlns:gc="http://www.xbrl.org/uk/fr/gcd/2004-12-01" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:iso4217="http://www.xbrl.org/2003/iso4217" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:pt="http://www.xbrl.org/uk/fr/gaap/pt/2004-12-01" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<link:schemaRef xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="http://www.companieshouse.gov.uk/ef/xbrl/uk/fr/gaap/ae/2009-06-21/uk-gaap-ae-2009-06-21.xsd" xlink:type="simple" />
<ae:CompanyNotDormant contextRef="y2013">true</ae:CompanyNotDormant>
<gc:EntityNames>
  <gc:EntityCurrentLegalName contextRef="y2013">A &amp; Co. Limited</gc:EntityCurrentLegalName>
</gc:EntityNames>
<ae:CompanyIdentifyingNumbers>
  <ae:CompaniesHouseRegisteredNumber contextRef="y2013">123456</ae:CompaniesHouseRegisteredNumber>
</ae:CompanyIdentifyingNumbers>
<gc:StatementDatesPeriodsCovered>
  <gc:BalanceSheetDate contextRef="e2013">2013-03-31</gc:BalanceSheetDate>
</gc:StatementDatesPeriodsCovered>

<pt:ShareholderFunds precision="5" contextRef="e2013" unitRef="GBP">5286</pt:ShareholderFunds>
<pt:ShareholderFunds precision="5" contextRef="e2012" unitRef="GBP">5446</pt:ShareholderFunds>

<unit id="shares">
  <measure>xbrli:shares</measure>
</unit>
<unit id="GBP">
  <measure>iso4217:GBP</measure>
</unit>
<unit id="pure">
  <measure>xbrli:pure</measure>
</unit>

<context id="e2012">
  <entity>
    <identifier scheme="Ellco/results">A &amp; Co. Limited</identifier>
  </entity>
  <period>
    <instant>2012-03-31</instant>
  </period>
</context>
<context id="s2013">
  <entity>
    <identifier scheme="Ellco/results">A &amp; Co. Limited</identifier>
  </entity>
  <period>
    <instant>2012-03-31</instant>
  </period>
</context>
<context id="e2013">
  <entity>
    <identifier scheme="Ellco/results">A &amp; Co. Limited</identifier>
  </entity>
  <period>
    <instant>2013-03-31</instant>
  </period>
</context>
<ae:CompaniesHouseDocumentAuthentication contextRef="y2013"> </ae:CompaniesHouseDocumentAuthentication>
<ae:DateAccountsReceived contextRef="e2013">2013-12-25</ae:DateAccountsReceived>
</xbrl>

No correct solution

OTHER TIPS

Using XPath, I was able to select two different dates with this code:

/xbrl/context[@id = /xbrl/pt:ShareholderFunds/@contextRef]/period/instant

The expression selects the xbrl/context elements which have an id attribute that correspond to the /xbrl/pt:ShareholderFunds contextRef attribute, and gets the period/instant in each one. The result of the selection is a node-set containing:

2012-03-31
2013-03-31
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top