xbrl processor development guide -...
TRANSCRIPT
ii
Preface
Purpose
This manual, the Interstage XWand Development Guide, is intended for developers of
applications that can handle XML documents compliant with the syntax defined in the XBRL 2.1 using the XBRL processor provided by Interstage XWand. The manual provides an outline of
the XBRL processor, and describes XBRL processor-supported functions and how to use them.
Intended Readers
This manual is intended for developers who use the XBRL processor provided by Interstage XWand to develop user applications that can handle XML documents compliant with the syntax
defined in the XBRL 2.1 Specification.
Prerequisite Knowledge
Readers are assumed to have an understanding of the following standard specifications and
related standard specifications:
- Extensible Markup Language (XML) 1.0 (Second Edition) W3C Recommendation 6 October 2000
- XML Schema Part 0: Primer W3C Recommendation, 28 October 2004
- XML Schema Part 1: Structures W3C Recommendation 28 October 2004 - XML Schema Part 2: Datatypes W3C Recommendation 28 October 2004
- Namespaces in XML World Wide Web Consortium 14-January-1999 - XML Path Language (XPath) Version 1.0 W3C Recommendation 16 November 1999
- XPointer Framework W3C Recommendation 25 March 2003 - XPointer element() Scheme W3C Recommendation 25 March 2003
- XML Base W3C Recommendation 27 June 2001 - XML Linking Language (XLink) Version1.0 W3C Recommendation 27 June 2001
- XBRL 2.1 Specification - Document Object Model (DOM) Level 2 Core Specification Version 1.0
Organization of This Manual
This manual has the seven chapters and two appendixes listed below.
Chapter 1 XBRL Processor Overview Chapter 1 provides an overview of the XBRL processor.
Chapter 2 Basic XBRL Processor Information Chapter 2 provides basic information for use of the XBRL processor.
Chapter 3 Creating and Saving XBRL Data Models Chapter 3 explains how to create and save documents using XBRL data models.
Chapter 4 Referencing with XBRL Data Models Chapter 4 explains how to reference document information by using XBRL data models.
Chapter 5 Modifying with XBRL Data Models Chapter 5 explains how to register and modify document information by using XBRL data
models. Chapter 6 Tutorial
Chapter 6 explains in detail how to use XBRL data models.
iii
Chapter 7 Specifications and Restrictions Chapter 7 explains the specifications and restrictions to keep in mind when using this product.
Chapter 8 Changes in API Specifications Chapter 7 explains the changes in API specifications from the previous version.
Appendix A Tutorial Source Code Appendix A provides a complete version of the source code explained in Chapter 6,
"Tutorial," and its execution results. Appendix B Samples of Overridden Documents
Appendix B provides samples of documents with overridden links.
How to Use this Manual
This manual is a development guide for the following product:
- XBRL processor This manual has been prepared to assist persons using the manual and the related manual (see
below) in developing XBRL document-processing applications using the XBRL processor.
Related Manual
XBRL Processor XBRL 2.1 C#, COM Interface API Reference (hereinafter called as "XBRL API Reference")
Export Restrictions
This software product is designed primarily for use in the country to which the software is imported. The software must not be re-exported from the country without authorization from the
appropriate government authorities in accordance with the Foreign Exchange and Foreign Trade Control Law of the country. In no event will Fujitsu be liable for foreign government or
third-party claims for compensation or damages whatsoever arising from the use of the software resulting in any violation of the laws and ordinances of the country or those of the relevant
country. Fujitsu assumes no responsibility for any problems or damages arising from such use of the software outside the country. If Fujitsu suffers any damages as a result of a user's violation of
the above laws, Fujitsu reserves the right to claim compensation from the user.
Abbreviation
In this manual, the Interstage XWand XBRL processor is referred to as: - XBRL processor
iv
Trademarks
XBRL, is a trademark or service mark of XBRL International, Inc., registered in the United
States and in other countries. Windows, .NET Framework and COM are either trademarks or registered trademarks of Microsoft
Corporation in the United States and/or other countries. Other company names and product names are trademarks or registered trademarks of their
respective owners. Company and product names appearing in this manual are the trademarks or registered
trademarks of their respective owners. The contents of this manual may be revised without prior notice.
The contents of this manual shall not be reproduced in any way or form without the express written permission of Fujitsu Limited.
Fujitsu assumes no responsibility for infringement of any patent rights or other rights of third parties arising from the use of the information in this manual.
Date of Issue
December 2011: First Edition
v
Contents
CONTENTS V
CHAPTER 1 XBRL PROCESSOR OVERVIEW .............................................................................................. 7
1.1 PURPOSE ............................................................................................................................................................................... 7 1.2 TERMINOLOGY .................................................................................................................................................................... 7
CHAPTER 2 BASIC XBRL PROCESSOR INFORMATION ......................................................................... 8
2.1 XBRL DOCUMENTS ........................................................................................................................................................... 8 2.1.1 Overview of Instance document elements ......................................................................................................... 8 2.1.2 Overview of taxonomy structure.......................................................................................................................... 9
2.2 XBRL DATA MODEL ........................................................................................................................................................ 9 2.2.1 Models common to instance documents and taxonomies ........................................................................... 10 2.2.2 Model specific to an instance document ......................................................................................................... 13 2.2.3 Model specific to taxonomies ............................................................................................................................. 14
2.3 OVERVIEW OF THE XBRL PROCESSOR ....................................................................................................................... 15 2.4 XBRL PROCESSOR SETTINGS ............................................................................................................................................ 16
2.4.1 Setting an error handler ........................................................................................................................................... 16 2.4.2 Setting an entity resolver .......................................................................................................................................... 16 2.4.3 Setting a taxonomy set resolver ............................................................................................................................... 17
CHAPTER 3 CREATING AND SAVING XBRL DATA MODELS ............................................................. 19
3.1 CREATING AN XBRL DATA MODEL ........................................................................................................................... 19 3.1.1 Creating an XBRL data model ........................................................................................................................... 19 3.1.2 Converting an existing XBRL document into an XBRL data model ....................................................... 19 3.1.3 Creating an XBRL data model from serialized data ................................................................................... 19 3.1.4 Creating an XBRL data model by reading extended taxonomy additionally ....................................... 19
3.2 SAVING AN XBRL DATA MODEL ................................................................................................................................ 21 3.2.1 Saving as an XBRL document ............................................................................................................................ 21 3.2.2 Serialization ............................................................................................................................................................ 21
CHAPTER 4 REFERENCING WITH XBRL DATA MODELS .................................................................... 22
4.1 SCHEMA .............................................................................................................................................................................. 22 4.1.1 Referencing a schema ........................................................................................................................................... 23 4.1.2 Referring to "element" elements ........................................................................................................................ 25
4.2 INSTANCE DOCUMENT .................................................................................................................................................... 27 4.2.1 Referencing instance information ..................................................................................................................... 27 4.2.2 Referencing context and unit .............................................................................................................................. 27 4.2.3 Referencing item values ....................................................................................................................................... 28
4.3 LINKS ................................................................................................................................................................................... 30 4.3.1 Linkbase information ............................................................................................................................................ 31 4.3.2 Link and link information .................................................................................................................................... 31 4.3.3 Referencing a relation link .................................................................................................................................. 31 4.3.4 Referencing a resource link ................................................................................................................................ 35 4.3.5 Executing calculations and referencing calculation results via calculation links ................................... 36 4.3.6 Referencing links where overriding is resolved ...................................................................................................... 37
vi
CHAPTER 5 MODIFYING WITH XBRL DATA MODELS ........................................................................... 38
5.1 ADDING A NEW ELEMENT .............................................................................................................................................. 38 5.2 CHANGING THE CONTENTS OF AN EXISTING ELEMENT ......................................................................................... 39 5.3 DELETING AN EXISTING ELEMENT .............................................................................................................................. 39 5.4 OVERRIDING LINKS .......................................................................................................................................................... 40
5.4.1 Link overriding ....................................................................................................................................................... 40 5.4.2 Creating a process for overriding .................................................................................................................... 40
CHAPTER 6 TUTORIAL ....................................................................................................................................... 42
6.1 CREATING A NEW TAXONOMYSET .............................................................................................................................. 42 6.2 ADDING A SCHEMA .......................................................................................................................................................... 42 6.3 IMPORTING XBRL-INSTANCE.XSD ................................................................................................................................. 42 6.4 ADDING AN "ELEMENT" ELEMENT .............................................................................................................................. 43 6.5 ADDING A LINK ................................................................................................................................................................. 43
6.5.1 Adding a relation link ........................................................................................................................................... 43 6.5.2 Adding a resource link ......................................................................................................................................... 44
6.6 CREATING AN INSTANCE AND ADDING AN ITEM ..................................................................................................... 44 6.7 SAVING XBRL DOCUMENTS ......................................................................................................................................... 46
CHAPTER 7 SPECIFICATIONS AND RESTRICTIONS.............................................................................. 47
7.1 HANDLING OF ELEMENTS BY THE XBRL PROCESSOR ........................................................................................... 47 7.1.1 Elements relating to taxonomies and schemas .............................................................................................. 47 7.1.2 Elements relating to linkbases ........................................................................................................................... 51 7.1.3 Instance-related elements .................................................................................................................................... 53 7.1.4 Common elements .................................................................................................................................................. 56
7.2 OTHER SPECIFICATIONS .................................................................................................................................................. 56 7.3 RESTRICTIONS ................................................................................................................................................................... 58 7.4 NOTES .................................................................................................................................................................................. 58
CHAPTER 8 CHANGES IN API SPECIFICATIONS .......................................................................................... 59
8.1 CHANGES / DIFFERENCES IN API SPECIFICATIONS FROM V1.2 ........................................................................................ 59 8.2 CHANGES / DIFFERENCES IN API SPECIFICATIONS FROM V7.0 ........................................................................................ 64 8.3 CHANGES / DIFFERENCES IN API SPECIFICATIONS FROM V7.1 ........................................................................................ 66 8.4 CHANGES / DIFFERENCES IN API SPECIFICATIONS FROM V9.0 ........................................................................................ 67
APPENDIX A TUTORIAL SOURCE CODE ...................................................................................................... 69
APPENDIX B SAMPLES OF OVERRIDDEN DOCUMENTS ....................................................................... 75
7
Chapter 1 XBRL Processor Overview
1.1 Purpose
The XBRL processor provides a function for handling instance documents and taxonomies as defined in the XBRL 2.1 Specification.
1.2 Terminology
This manual uses the terms defined in the following specification: XBRL2.1 Specification
Other terms are explained below.
XBRL document A general term for instance documents and taxonomies
XBRL data model A unique data model provided by the XBRL processor. An XBRL data model is configured so that
instance documents and taxonomies can be handled. Item definition element
An abbreviation for the "element" element of the schema defining an item Tuple definition element
An abbreviation for the "element" element of the schema defining a tuple XBRL element
A generic term for item definition elements and tuple definition elements, or structure elements of the XBRL data model corresponding to them
Taxonomy set Structure element of the XBRL data model that is used to model the Discoverable Taxonomy Set
(DTS). Property
Attributes related to XBRL processor operation Link information
General term for information on links such as arcs and locators Override
A function that overrides links to replace them. For details, see Section 5.4 "Overriding Links"
8
Chapter 2 Basic XBRL Processor Information
The XBRL processor creates a model of the syntax defined in the XBRL 2.1 Specification so that XBRL
documents can be used in a .NET Framework environment. This chapter covers the following:
1) Overview of XBRL documents 2) Relationship between XBRL documents and XBRL data models
3) XBRL document processing by the XBRL processor
2.1 XBRL Documents
XBRL documents are classified into instance documents and taxonomies.
2.1.1 Overview of Instance document elements
Taxonomies describe the relationships between elements making up an instance document. An instance document, with its elements and attributes, stores different types of facts as business entities.
The figure below shows the structure of an instance document. Some elements and attributes are omitted.
Context elements
Tuple elements
Item elements
Tuple elements
footnoteLink element
Item elements
roleRef/arcroleRef element
schemaRef/linkbaseRef element
Unit elements
xbrl element
Figure 1 Structure of instance document
9
2.1.2 Overview of taxonomy structure
A taxonomy consists of a schema and linkbase. The schema defines the method of coding an instance document with an "element" element. The linkbase defines the relationships between XBRL elements or
between XBRL elements and their associated information. The figure below shows the structure of the schema. Some elements and attributes are omitted.
schema element
"element" elements
appinfo elements
import elements
annotation elements
linkbaseRef element
Figure 2 Structure of the schema
The figure below shows the structure of the linkbase. Note that some elements and attributes are omitted.
linkbase element
Extended link declaration elements
Locator resource elements
Arc elements
Figure 3 Structure of the linkbase
2.2 XBRL Data Model
The XBRL data model is a model for instance documents and taxonomies and natively supported by the
XBRL processor. Compared with DOMs, XBRL data models simplify operations on instance documents and taxonomies based on the XBRL 2.1 specification.
XBRL data models are classified into the following three types: Models common to instance documents and taxonomies
Models specific to an instance document Models specific to taxonomies
10
2.2.1 Models common to instance documents and taxonomies
The common data model is a model for the following elements and structures: Common characteristics of XBRL documents
Instance documents, schemas, and linkbase documents are included in the model.
<<interface>>
XBRLDocument
<<interface>> Instance
<<interface>> XMLSchema
Common characteristics for each XBRL documents are modeled.
<<interface>> Linkbase Documents that
provides linkbases
Document that provides instances
Document that provides schemas
Figure 4 Common data model
11
Basic information about links
- Information representing individual links that are associated with extended-link-type elements and their sub-elements is modeled.
<<interface>>
LinkInformation
<<interface>> Arc
<<interface>> Locator
Provides information about an arc-type element.
Provides information about an locator-type element or resource-type element.
Provides one piece of information about the beginning and end of a link included in one XLink declaration.
1 2
1 1
<<interface>>
XBRLDocument
<<interface>>XLinkDecl
Provides information about an extended-link-type element of one XLink declaration.
<<interface>>Arc
<<interface>>Locator
1 *
1 *
1 *
Figure 5 Basic information about links
- Characteristics common to extended-link-type elements and their sub-elements are modeled.
12
<<interface>>
Link
<<interface>> LinkInformation
Common characteristics for each link are modeled.
Provides about the footnoteLink extended-link-type element.
<<interface>> FootnoteLink
<<interface>> ReferenceLink
<<interface>> RelationLink
<<interface>> LabelLink
<<interface>> CalculationLink
<<interface>> DefinitionLink
<<interface>> PresentationLink
1 *
1 *
Provides about the referenceLink extended-link-type element.
Provides about the labelLink extended-link-type element.
Provides the caliculationLink extended-link-type element.
Provides the definitionLink extended-link-type element.
Provides the presentationLink extended-link-type element.
<<interface>> ResourceLink
Figure 6 Extended link-type element model
13
2.2.2 Model specific to an instance document
The model specific to an instance document models the individual elements defined for the instance document and their attributes. The figure below shows an outline of the model.
<<interface>>
Instance
<<interface>>Context
<<interface>>Period
<<interface>>Scenario
Context element model
Period element model
<<interface>>Unit
<<interface>> FootnoteLink
Scenario element model
<<interface>>ContextEntity Entity element model
<<interface>>Segment Segment element
model
Unit element model
<<interface>> InstanceElement Items and tuples
<<interface>> Item / Tuple
1 *
1 *
1 *
1 1
1 1
1 1
1 1
1 1
Figure 7 Model specific to instance documents
14
2.2.3 Model specific to taxonomies
The model specific to taxonomies models the information about links that can be defined in taxonomies and the import function defined in the XML schema. The figure below shows an outline of the model.
<<interface>>
Taxonomy
<<interface>>XMLSchema
<<interface>> PresentationLink
1 *
1 *
<<interface>> CalculationLink 1 *
<<interface>> DefinitionLink 1 *
<<interface>> LabelLink 1 1
<<interface>> ReferenceLink 1 1
Schema directly referenced from an instance document
<<interface>>XMLSchema 1 * Schema imported into another
schema
<<interface>>ElementDecl 1 * "Element" element
Figure 8 Model specific to taxonomies
15
2.3 Overview of the XBRL Processor
The XBRL processor (com.fujitsu.xml.xbrl.xwand.processor.XBRLProcessor) provides a function that enables XBRL document processing according to XBRL data models.
The XBRL processor facilitates the operations on XBRL data models. 1) Creating an XBRL data model
An XBRL document is created as an XBRL data model. The following functions are provided to create XBRL data models:
- Creating a new XBRL data model - Converting an existing XBRL document into an XBRL data model
2) Saving an XBRL data model XBRL data models can be saved in either of the following formats:
- XBRL document - XBRL data model object (serialization)
3) Referencing data in an XBRL document Data in an XBRL document can be referenced through XBRL data model elements.
4) Modifying data in an XBRL document Data in an XBRL document can be modified by manipulating XBRL data model elements. A function to
set options for processing XBRL documents is provided. The following two types of options are available:
Options that can be specified in the XBRL processor properties A property name defined in XBRLProperties is specified using the method shown below:
- XBRLProcessor.setProperty(string name, Object value) A property name defined in Fujitsu.XML.XBRL.Jaxp.Transform.OutputKeys is specified using the
method shown below:
- XBRLProcessor. setOutputProperty(String name, String value)
Options that can be specified directly in the XBRL processor
The following options can be specified:
- Setting the error handler XBRLProcessor.setErrorHandler(XBRLErrorHandler errHandler)
- Setting the entity resolver XBRLProcessor.setEntityResolver(XBRLEntityResolver entResolver)
- Setting the taxonomy set resolver XBRLProcessor.setTaxonomySetResolver(TaxonomySetResolver taxSetResolver)
16
2.4 XBRL Processor Settings
This section explains how to set handlers and resolvers for XBRL Processor.
2.4.1 Setting an error handler
Setting an error handler for XBRL Processor enables collection of errors, warnings, and other information issued during the read or write of an XBRL document.
Implement the XBRLErrorHandler interface to create the error handler.
/// <summary> /// <p> /// This is the handler used to output error, warning, and other information to the standard error output /// </p> /// </summary> class MyErrorHandler : XBRLErrorHandler { public void error(XBRLProcessorException exception, ref bool throwFlag) { System.Console.WriteLine("[ERROR] " + exception.Message); } public void fatalError(XBRLProcessorException exception, ref bool throwFlag) { System.Console.WriteLine("[FATAL ERROR] " + exception.Message); } public void warning(XBRLProcessorException exception, ref bool throwFlag) { System.Console.WriteLine("[WARNING] " + exception.Message); } public void message(XBRLProcessorException exception, ref bool throwFlag) { System.Console.WriteLine("[MESSAGE] " + exception.Message); } }
Set the created handler as shown below:
xbrlProc.ErrorHandler = new MyErrorHandler();
2.4.2 Setting an entity resolver
Setting an entity resolver for XBRL Processor enables resolution of XBRL file external references during read or write of an XBRL document. Use of an entity resolver means that, when an XBRL file references a remote file (for example, http://www.fujitsu.com/xbrl/sample.xsd or similar), a local file (for example, C:¥xbrl¥sample.xsd or similar) is loaded instead of the remote file. Use an entity resolver if the computer running XBRL processor cannot access remote files or if you do not want to access remote files.
Implement the XBRLEntityResolver interface to create the entity resolver.
17
/// <summary> /// <p> /// This is the resolver for resolving external references. /// Set to suit your environment. /// </p> /// <p> /// The resolver created here is used when the read XBRL file /// (input instance and the schemas and so on that they reference) references a remote file. /// The resolver is used to read a local file without accessing the remote file. /// </p> /// </summary> class MyEntityResolver : XBRLEntityResolver { // This is the remote file path applied by the resolver. // Modify to suit your environment. private static readonly string REMOTE_PATH = "http://info.edinet-fsa.go.jp/"; // This is the path to the local file where the above file has been copied. private static readonly string LOCAL_PATH = "file:///C:/xbrl/edinet/"; // Called when the XBRL file is loaded. public Source resolveInputEntity(string namespaceURI, string sysId) { // The local file stream is returned for references that are presumed to be external references. // This enables processing to continue without accessing remote files. if (sysId != null && sysId.StartsWith(REMOTE_PATH)) { // The remote file path is replaced by the local file path. string newSysId = LOCAL_PATH + sysId.Substring(REMOTE_PATH.Length); // The file read stream is returned from the local file path. return new StreamSource(newSysId); } return null; } // Called when the XBRL document is written. When a remote file is edited and saved locally, set such that the save destination is returned instead of a null. public Result resolveOutputEntity(string namespaceURI, string sysId) { return null; } }
Set the created resolver as shown below:
xbrlProc.setEntityResolver(new MyEntityResolver());
2.4.3 Setting a taxonomy set resolver
Setting a taxonomy set resolver for XBRL Processor enables resolution of taxonomies during read of an XBRL document. Use of a taxonomy set resolver means that when an XBRL file references an already processed taxonomy, it can be used in a DTS construction without newly reading and analysing the taxonomy. If more than one XBRL file references the same taxonomy, a taxonomy set resolver is used to cache the already processed taxonomy and thereby reduce the processing time for DTS construction.
Implement the TaxonomySetResolver interface to create a taxonomy set resolver.
18
/// <summary> /// This is a resolver for caching taxonomies. /// </summary> public class MyTaxonomySetResolver : TaxonomySetResolverEx { private string m_namespace; private TaxonomySet m_taxonomySet; public MyTaxonomySetResolver(string namespaceURI, TaxonomySet taxonomySet) { // Sets the cache. // In this example, only one taxonomy is cached, but set to suit your environment // such that all the required taxonomies are cached. this.m_namespace = namespaceURI; this.m_taxonomySet = taxonomySet; } // Called if a taxonomy reference is found. public TaxonomySet resolve(string[] xsNsURIs, string[] xsSysIds, string[] lbSysIds) { // If the referenced taxonomy is held in the cache, the cached taxonomy is returned. // In this example, the judgement is based on the namespace name of a single schema but, // depending on your environment, set a system identifier including more // than one namespace name or linkbase for the judgement. if (this.contains(xsNsURIs, m_namespace)) { return m_taxonomySet; } return null; } // This method is not called. This method is called only if // TaxonomySetResolver is implemented rather than TaxonomySetResolverEx. public TaxonomySet resolve(string[] xsSysIds, string[] lbSysIds) { return null; } private bool contains(string[] xsNsURIs, string namespaceURI) { for (int i = 0; i < xsNsURIs.Length; i++) { if (namespaceURI.Equals(xsNsURIs[i])) { return true; } } return false; } }
Set the created resolver as shown below:
xbrlProc.TaxonomySetResolver = new MyTaxonomySetResolver(namespaceURI, taxonomySet);
19
Chapter 3 Creating and Saving XBRL Data Models
3.1 Creating an XBRL Data Model
3.1.1 Creating an XBRL data model
Use the methods shown below to create a new XBRL data model. The methods create an XBRL data
model not having XBRL document information.
- XBRLProcessor.newTaxonomySet()
- XBRLProcessor.newInstance(TaxonomySet taxonomySet) - XBRLProcessor.newInstance(TaxonomySet taxonomySet, string sysId)
3.1.2 Converting an existing XBRL document into an XBRL data model
If an XBRL document is converted into an XBRL data model by the XBRL processor, different types of
operations can be performed with the document. The XBRL processor supports the methods explained below to read existing XBRL documents and create
XBRL data models thereof. Each of the methods can read an XBRL document in the desired format as specified with Fujitsu.XML.XBRL.Jaxp.Transform.Source for specifying input. During reading of the XBRL
document, the document is checked to verify that it is a valid XBRL document. 1) Reading a taxonomy
The following methods are used to read a taxonomy as an XBRL data model:
- XBRLProcessor.loadTaxonomySet(Fujitsu.XML.XBRL.Jaxp.Transform.Source xsSource) - XBRLProcessor.loadTaxonomySet(Fujitsu.XML.XBRL.Jaxp.Transform.Source [] xsSources) - XBRLProcessor.loadTaxonomySet(Fujitsu.XML.XBRL.Jaxp.Transform.Source [] xsSources,
Fujitsu.XML.XBRL.Jaxp.Transform.Source [] lbSources)
2) Reading an instance document The following methods are used to read an instance document as an XBRL data model:
- XBRLProcessor.loadInstance(Fujitsu.XML.XBRL.Jaxp.Transform.Source insSource) - XBRLProcessor.loadInstance(TaxonomySet taxonomySet,
Fujitsu.XML.XBRL.Jaxp.Transform.Source insSource)
3.1.3 Creating an XBRL data model from serialized data
An XBRL data model can be saved as an object via serialization, which is explained in a subsequent
section. Serialized object data can be read as an XBRL data model using the method shown below. Furthermore, serialized object data can be read in the desired format as specified in System.IO.Stream for
specifying input. XBRLProcessor.deserializeTaxonomySet(System.IO.Stream inStream)
3.1.4 Creating an XBRL data model by reading extended taxonomy additionally
Use the methods shown below to create a new XBRL data model where extended taxonomy information is added to the existing XBRL data model.
- XBRLProcessor. appendTaxonomySet(TaxonomySet taxonomySet,
Fujitsu.XML.XBRL.Jaxp.Transform.Source xsSource) - XBRLProcessor. appendTaxonomySet(TaxonomySet taxonomySet,
Fujitsu.XML.XBRL.Jaxp.Transform.Source[] xsSources)
20
- XBRLProcessor. appendTaxonomySet(TaxonomySet taxonomySet, Fujitsu.XML.XBRL.Jaxp.Transform.Source[] xsSources, Fujitsu.XML.XBRL.Jaxp.Transform.Source[] lbSources)
Using an existing XBRL data model, following process will be improved. These are effective when handling multiple taxonomies having the same base taxonomy in common.
Reduction in reading time of taxonomy The reading time of taxonomy can be shortened by making an XBRL data model of base
taxonomy beforehand and reading only the extended taxonomy in the following processing. Reduction in memory use
By sharing an XBRL data model of base taxonomy, memory consumption will be reduced.
Note : In the above, the XBRL data model of base taxonomy part is read-only.
21
3.2 Saving an XBRL Data Model
3.2.1 Saving as an XBRL document
An XBRL data model can be saved as an XBRL document as follows:
1) Saving a taxonomy The following methods are used to save a taxonomy from an XBRL data model:
- XBRLProcessor.saveTaxonomy(XMLSchema schema) - XBRLProcessor.saveXMLSchema(XMLSchema schema,
Fujitsu.XML.XBRL.Jaxp.Transform.Result result) - XBRLProcessor.saveLinkbase(Linkbase linkbase,
Fujitsu.XML.XBRL.Jaxp.Transform.Result result)
2) Saving an instance document The following method is used to save an instance document from an XBRL data model:
- XBRLProcessor. saveInstance(Instance instance, Fujitsu.XML.XBRL.Jaxp.Transform.Result result)
The prefix of each name (QName) of some elements used in the XBRL document is replaced with an
automatically assigned one according to an XBRL processor specification. For details, see Chapter 7, "Specifications and Restrictions" in this manual.
3.2.2 Serialization
An XBRL data model can be saved not only as an XBRL document and XBRL data model, but also as an object (serialized data). An XBRL data model can be saved by this way even if the XBRL data model have
wrong and can not be saved as an XBRL document.
- XBRLProcessor.serializeTaxonomySet(TaxonomySet taxonomySet, System.IO.Stream outStream)
22
Chapter 4 Referencing with XBRL Data Models
Information about an XBRL document can be obtained from elements of an XBRL data model. The
following three types of elements in XBRL data models can be referenced: Schema
Instance document Link (link base, link in an instance document)
Referencing of each element starts from TaxonomySet or Instance. See Section 3.1.2, "Converting an existing XBRL document into an XBRL data model," and confirm the method of obtaining TaxonomySet
or Instance object. The subsequent descriptions assume that the Instance object is obtained as follows:
Example: Obtain an XBRL data model from the document named sample_instance.xml. XBRLProcessor xbrlProc = new XBRLProcessor(); Instance instance = xbrlProc.loadInstance( new StreamSource("sample_instance.xml")); TaxonomySet taxonomySet = instance.TaxonomySet;
4.1 Schema
In an XBRL data model, a schema consists of schema information, schema import information, and "element" elements defined in the schema.
One XBRL data model can have multiple schemas. Furthermore, multiple schemas can be imported in one schema. The figure below shows an XBRL document with multiple schemas that involves schema
import relationship between them.
XBRL document
Instance document Schema 1
Schema 2'Item C
Schema 2
Import
<A>100</A> Item A
<B>100</B> Item B
<C>100</C> (Item C)
Figure 9 Relationship between an instance document and importing of schemas
23
4.1.1 Referencing a schema
Schema (XMLSchema) A schema is obtained from TaxonomySet by specifying an index with the following method:
Property TaxonomySet.PrimarySchemas Example: Refer to a schema. [Sample instance document] <?xml version="1.0" encoding="UTF-8"?> <xbrl ... xsi:schemaLocation="http://www.fujitsu.com/demo/2002-11-11 schema0.xsd http://www.fujitsu.com/demo/2002-11-18 schema1.xsd"> <link:schemaRef ... xlink:href="schema0.xsd"> <link:schemaRef ... xlink:href="schema1.xsd"> ... [Sample program] XMLSchema schema0 = (XMLSchema)taxonomySet.PrimarySchemas.get(0); XMLSchema schema1 = (XMLSchema)taxonomySet.PrimarySchemas.get(1); [Results] schema0.SystemId : schema0.xsd schema0.TargetNamespace : http://www.fujitsu.com/demo/2002-11-11 schema1.SystemId : schema1.xsd schema1.TargetNamespace : http://www.fujitsu.com/demo/2002-11-18
Indexes are integers beginning from 0 that are used to indicate the sequence in which objects are stored. An integer in the following range can be specified for an index:
0 index < number of objects For every reference procedure with the index specified, a procedure for checking the number of
objects is provided. As a concrete example, the following shows a procedure for checking the number of schemas:
Example: Check the number of schemas. [Example instance document] <?xml version="1.0" encoding="UTF-8"?> <xbrl ... xsi:schemaLocation="http://www.fujitsu.com/demo/2002-11-11 schema0.xsd http://www.fujitsu.com/demo/2002-11-18 schema1.xsd"> <link:schemaRef ... xlink:href="schema0.xsd"> <link:schemaRef ... xlink:href="schema1.xsd"> ... [Sample example] int count = taxonomySet.PrimarySchemas.size(); [Results] count : 2
Before specifying the index, check the number of objects to confirm that the specified value does not
exceed the number of objects.
Schema importing Imported schemas can be obtained from the schema in which they were imported. Imported
schemas can be referenced with the following method:
Property XMLSchema.BaseSchemas Example: Refer to the first schema import information.
24
[Sample schema document] <?xml version="1.0" encoding="UTF-8"?> <schema ...> <import namespace="http://www.fujitsu.com/demo/2002-11-18" schemaLocation="sample1.xsd"/> ... [Sample program] XMLSchema schema = (XMLSchema)taxonomySet.PrimarySchemas.get(0); XMLSchema baseSchema = (XMLSchema)schema.BaseSchemas.get(0); string namespaceURI = baseSchema.TargetNamespace; [Results] namespaceURI : http://www.fujitsu.com/demo/2002-11-18
Schema include Included schemas can be obtained from the schema in which they were included with the
following method:
Method XMLSchema.IncludedSchemas Example: Refer to the first schema include information. [Sample schema document] <?xml version="1.0" encoding="UTF-8"?> <schema ...> <include schemaLocation="sample1.xsd"/> ... [Sample program] XMLSchema schema = (XMLSchema)taxonomySet.PrimarySchemas.get(0); XMLSchema includedSchema = (XMLSchema)schema.IncludedSchemas.get(0); string namespaceURI = includedSchema.getTargetNamespaceOfIncludingSchema(); [Results] namespaceURI : http://www.fujitsu.com/demo/2002-11-18
To get the included schemas information, following setting is required for XBRLProcessor before reading the taxonomy:
[Sample program] XBRLProcessor xbrlProc = new XBRLProcessor(); xbrlProc.setProperty(XBRLProperties_Fields.MERGE_INCLUDED_SCHEMA, XBRLProperties_Fields.NO); TaxonomySet taxonomySet = xbrlProc.loadTaxonomySet(...);
Note that if the above setting is not done, included schemas are unified into the schema in which they were included.
Example: Refer to the first schema include information. -> fail [Sample schema document] <?xml version="1.0" encoding="UTF-8"?> <schema ...> <include schemaLocation="sample1.xsd"/> ... [Sample program] XBRLProcessor xbrlProc = new XBRLProcessor(); TaxonomySet taxonomySet = xbrlProc.loadTaxonomySet(...); XMLSchema schema = (XMLSchema)taxonomySet.PrimarySchemas.get(0); XMLSchema includedSchema = (XMLSchema)schema.IncludedSchemas.get(0); -> IndexOutOfBoundsException
Schema referencing using a namespace name
A schema in a taxonomy set can be obtained using a namespace name as the key.
Method TaxonomySet.getXMLSchema(string namespaceURI)
25
Example: Refer to the schema of a specific namespace name. [Sample program] XMLSchema schema = (XMLSchema)taxonomySet. getXMLSchema ("http://www.fujitsu.com/demo/2002-11-18"); string namespaceURI = schema.TargetNamespace; [Results] namespaceURI : http://www.fujitsu.com/demo/2002-11-18
All schemas
All schemas in a taxonomy set can be obtained.
Method TaxonomySet.AllSchemas
4.1.2 Referring to "element" elements
"Element" elements are defined for individual schemas.
Referencing from a schema "Element" elements can be referenced from XMLSchema by using an index.
Property XMLSchema.ElementDecls Example: Refer to the element at the beginning of the document. [Sample document] <?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" ...> <element id="cash" name="cash" ... type="xbrli:monetaryItemType" substitutionGroup="xbrli:item"/> ... [Sample program] XMLSchema schema = (XMLSchema)taxonomySet.PrimarySchemas.get(0); ElementDecl element = schema.ElementDecls.get(0); [Results] element.Id : cash element.Name : cash
An "element" element is an item definition element, tuple definition element or other definition
element. The type of element can be determined by using the following method:
Property ElementDecl.ItemDecl ElementDecl.TupleDecl Example: Determine the type of the XBRL element. if(element.ItemDecl) { ...(Processing)... }
Referencing with a name or id An "element" element can be referenced from XMLSchema by specifying an index. For ease of use,
a reference procedure using a specified name or id is provided.
Method XMLSchema.getElementDeclByName(string name) XMLSchema.getElementDeclById(string id)
26
Example: Refer to the cash account elements. [Sample document] <?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" <element id="cash" name="cash" ... type="xbrli:monetaryItemType" substitutionGroup="xbrli:item"/> ... [Sample program] XMLSchema schema = (XMLSchema)taxonomySet.PrimarySchemas.get(0); ElementDecl element = schema.getElementDeclByName("cash"); [Results] element.Id : cash element.Name : cash
If no element with the specified name or id is found , null is returned.
Attribute of an item definition element
Of "element" elements, the item definition elements have the balance attribute and periodType attribute.
Property ElementDecl.Balance ElementDecl.PeriodType Example: Obtain the balance attribute. [Sample document] <?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" <element id="cash" name="cash" xbrli:balance="debit" ... type="xbrli:monetaryItemType" substitutionGroup="xbrli:item"/> ... [Sample program] if(element.ItemDecl) { string balance = element.Balance; //Acquisition of balance attribute } [Results] balance : debit
The above explanation covers an attribute which is used only in item definition elements. For
information about other attributes used by "element" elements, see the "XBRL API Reference". Values assigned to items by using instance documents can be obtained with the Item method, not
with ElementDecl. The next section covers this in detail.
27
4.2 Instance Document
In an XBRL data model, an instance document consists of document information (Instance), item information, values assigned to items (Item), and context.
4.2.1 Referencing instance information
To reference instance document information, use the method defined in Instance.
Example: Refer to instance document information. string sysId = instance.SystemId;
4.2.2 Referencing context and unit
When a value is assigned to an item in an XBRL document, attribute information can be set. The attribute information is referred to as context. The context is coded separately from an item and is referenced from
the item. Coding the context separately enables the reuse of the same group of attributes. In the XBRL2.1 Specification, a unit is coded separately from the context.
Referencing a context A context is coded in an instance document. It can be referenced from Instance by specifying an
index.
Property Instance.Contexts Example: [Sample document] <?xml version="1.0" encoding="UTF-8"?> <xbrl ...> ... <context id="context1"> <entity> <identifier scheme="http://www.fujitsu.com/demo/2002-11-11">demo1</identifier> </entity> <period> <instant>2002-11-11</instant> </period> </numericContext> ... [Sample program] Context context = instance.Contexts.get(0); [Results] context.Id : context1
Context sub-elements
A context has three sub-elements: entity (XBRLEntity), period, and scenario. These sub-elements are handled as classes in an XBRL data model.
Property Context.Entity Context.Scenario Context.Period Example: ContextEntity entity = context.Entity; // Entity acquisition Scenario scenario = context.Scenario; // Scenario acquisition Period period = context.Period; // Period acquisition
28
The entity and period elements are always required. For details about individual elements, see the
"XBRL API Reference".
Referencing a unit A unit is coded in an instance document. It is referenced from Instance by specifying an index.
Property Instance.Units Example: [Sample document] <?xml version="1.0" encoding="UTF-8"?> <xbrl ...> ... <unit id="unit1"> <measure>ISO4217:JPY</measure> </unit> ... [Sample program] Unit unit = instance.Units.get(0); [Results] unit.Id : unit1
4.2.3 Referencing item values
An item value is data assigned by an instance document to an item definition element defined in a
taxonomy. Referencing values
The procedure for referencing values has the following format:
Property Item.SpecifiedValue Example: Refer to a value. 1 [Sample document] <?xml version="1.0" encoding="UTF-8"?> <xbrl ...> <fj:Name contextRef="context2" xml:lang="ja"> Fujitsu Kabushikigaishya</fj:Name> <fj:Name contextRef="context2" xml:lang="en">Fujitsu Ltd.</fj:Name> [Sample program] Item item0 = (Item)instance.Children.get(0); Item item1 = (Item)instance.Children.get(1); string value0 = item0.SpecifiedValue; string value1 = item1.SpecifiedValue; [Results] value0 : Fujitsu Ltd. value1 : Fujitsu
An item can be obtained from the tree having Instance as the root. In the above example, the first and second children of Instance are obtained as items because two items exist right under the root.
Item type
Items are numeric or non-numeric. The type of an item can be checked by using the following method to compare the item with the InstanceElementType constant:
29
Property Item.ElementType Example: Determine the type of item. if(item.ElementType == InstanceElementType.ELEMENT_TYPE_NUMERIC_ITEM) { NumericItem nItem = (NumericItem)item; ...(Processing)... }
A non-numeric type can be cast to NonNumericItem to obtain the language attribute.
Property NonNumericItem.Language Example: Obtain the language attributes of nonnumeric items. [Sample document] <?xml version="1.0" encoding="UTF-8"?> <xbrl ...> <fj:Name contextRef="context2" xml:lang="ja">Fujitsu Kabushikigaishya</fj:Name> <fj:Name contextRef="context2" xml:lang="en">Fujitsu Ltd.</fj:Name> [Sample program] NonNumericItem nnItem0 = (NonNumericItem)item0; NonNumericItem nnItem1 = (NonNumericItem)item1; string lang0 = nnItem0.Language; string lang1 = nnItem1.Language; [Results] lang0 : ja lang1 : en
However, the language attribute is not always defined. For example, a business entity such as a date is a nonnumeric value, but the language attribute may not be defined for it because the format of that
business entity is determined in the XBRL2.1 Specification and does not depend on the language. A numeric type can be cast to NumericItem to obtain a calculated value.
Property NumericItem.CalculatedValue Example: Obtaine a calculated value. [Sample document] <?xml version="1.0" encoding="UTF-8"?> <xbrl ...> <fj:cash contextRef="context1" ...>10000</fj:Name> <fj:cash contextRef="context1" ...>80</fj:Name> ... [Sample program] NumericItem nItem0 = (NumericItem)item0; NumericItem nItem1 = (NumericItem)item1; NumericValue value0 = nItem0.CalculatedValue; NumericValue value1 = nItem1.CalculatedValue; [Results] (The calculation results depend on the calculation link definition)
A procedure for actual calculation is described in a subsequent section.
30
4.3 Links
Links provide a function for describing the interrelationships between XBRL elements and a function for specifying a resource for an XBRL element or item.
Links are classified into two categories: tree-structured links and map-structured links. A tree-structured link is used to describe the interrelationships between XBRL elements. When resources are specified,
links are configured as a map of resources for XBRL elements or items. The figures below illustrate the two types of links.
Linkbase document XBRL document
XBRL element A
XBRL element B
XBRL element C
XBRL element D
. . .
Link 1XBRL element A
Link 2XBRL element B
Link 3XBRL element C
Link 4XBRL element D
Figure 10 Relation links
Linkbase document XBRL document
XBRL element A
XBRL element B
XBRL element C
XBRL element D
. . .
Link Resources XBRL element A XBRL element B XBRL element C
A
a
B
i
C
u
Figure 11 Resource links
31
4.3.1 Linkbase information
A linkbase document provides a taxonomy with a link structure and data. Information about links can be stored separately from schemas as separate documents.
Referencing linkbase information The XBRLDocument class provides a procedure for referencing linkbase information. To reference
linkbase information, use the method that is appropriate for the type of schema or instance document.
Method XBRLDocument.getLinkbases(LinkType linkType) Example: [Sample document] <?xml version="1.0" encoding="UTF-8"?> <schema ...> <annotation> <appinfo> <link:linkbaseRef xlink:type="simple" xlink:actuate="onRequest" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="link_presentation.xml" xlink:role="http://www.xbrl.org/2003/role/presentationLinkbaseRef"/> ... </appinfo> </annotation> ... [Sample program] XMLSchema schema = (XMLSchema)taxonomySet.PrimarySchemas.get(0); Linkbase linkbase = (Linkbase)schema.getLinkbases(LinkType.LINK_TYPE_PRESENTATION).get(0); [Results] linkbase.SystemId : link_presentation.xml
All linkbases To reference all linkbase information in the TaxonomySet, use the method of TaxonomySet.
Method TaxonomySet.getAllLinkbases(LinkType linkType)
4.3.2 Link and link information
Link
Link comprises the node entities that constitute a link. Its primary function is to store references to XBRL elements, other links and resource objects. The link data handling procedure itself becomes
a reference to a link. See the next section for information on the reference procedure. LinkInformation
LinkInformation represents the relationships between other links and resource objects stored in a link. This information is required for configuring a link or determining the type of connection to a link.
See the next section for information on the reference procedure. Anchor
Anchor is an XBRL element or item that is associated with a link. LinkModel
LinkModel is a model to handle Link and LinkInformation.
4.3.3 Referencing a relation link
To reference an XBRL element according to specified relationships, a link need first be referenced before
the XBRL element is referenced from the link.
32
Referencing a link To reference the node entity of a relation link, specify an index with TaxonomySet.
Property TaxonomySet.RootPresentationLinks TaxonomySet.RootCalculationLinks TaxonomySet.RootDefinitionLinks TaxonomySet.getRootRelationLinks(LinkType linkType) Example: [Sample document] link_presentaion.xml <?xml version="1.0" encoding="UTF-8"?> <linkbase ...> <presentationLink xlink:type="extended" ...> <loc xlink:type="locator" xlink:href="demo3_balancesheet.xsd#Document" xlink:label="src"/> ... </presentationLink> ... [Sample program] PresentationLink rootLink = (PresentationLink)taxonomySet.RootPresentationLinks.get(0); [Results] rootLink.Anchor : XBRL element"Document" (The RelationLink.Anchor property is explained later)
Although a relation link has a tree structure, only the node that becomes the root of the tree can be referenced from the TaxonomySet object. Subnodes under the root are acquired with the
RelationLink.getChildren property of each link.
Property RelationLink.getChildren Example: Refer to children nodes. [Sample document] <?xml version="1.0" encoding="UTF-8"?> <linkbase ...> <presentationLink xlink:type="extended" ...> <loc xlink:type="locator" xlink:href="demo3_balancesheet.xsd#Document" xlink:label="src"/> <loc xlink:type="locator" xlink:href="demo3_balancesheet.xsd#Company" xlink:label="dest"/> <presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="src" xlink:to="dest" .../> ... </presentationLink> <presentationLink xlink:type="extended" ...> <loc xlink:type="locator" xlink:href="demo3_balancesheet.xsd#Document" xlink:label="src"/> <loc xlink:type="locator" xlink:href="demo3_balancesheet.xsd#Title" xlink:label="dest"/> <presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="src" xlink:to="dest" .../> ... </presentationLink> ... [Sample program] PresentationLink rootLink = (PresentationLink)taxonomySet.RootPresentationLinks.get(0); PresentationLink childLink0 =
33
(PresentationLink)rootLink.Children.get(0); PresentationLink childLink1 = (PresentationLink)rootLink.Children.get(1); [Results] childLink0.Anchor : XBRL element"Company" childLink1.Anchor : XBRL element"Title"
When you want to split the tree structure of relation link according to its extended link role or
arcrole, specify the extended link role or arcrole to get the root node.
Method TaxonomySet.getRootPresentationLinks(string role, string arcrole) TaxonomySet.getRootPresentationLinks(RelationLinkFilter filter, string role, string arcrole) TaxonomySet.getRootCalculationLinks(string role, string arcrole) TaxonomySet.getRootCalculationLinks(RelationLinkFilter filter, string role, string arcrole) TaxonomySet.getRootDefinitionLinks(string role, string arcrole) TaxonomySet.getRootDefinitionLinks(RelationLinkFilter filter, string role, string arcrole) TaxonomySet.getRootRelationLinks(LinkType linkType, string role, string arcrole) TaxonomySet.getRootRelationLinks(LinkType linkType, RelationLinkFilter filter, string role, string arcrole)Example: [Sample document] link_presentaion.xml <?xml version="1.0" encoding="UTF-8"?> <linkbase ...> <presentationLink xlink:type="extended" xlink:role="http://www.fujitsu.com/xbrl/document1"...> <loc xlink:type="locator" xlink:href="demo3_balancesheet.xsd#Document" xlink:label="src"/> ... </presentationLink> ... [Sample program] PresentationLink rootLink = (PresentationLink)taxonomySet. getRootPresentationLinks("http://www.fujitsu.com/xbrl/document1", null).get(0); [Results] rootLink.getAnchor() : XBRL element "Document"
Subnodes under the root are acquired with the call of
RelationLink.getChildModels(RelationLinkFilter filter, string role, string arcrole) method etc.
Method RelationLink.getChildModels(RelationLinkFilter filter, string role, string arcrole) ElementDecl.getChildRelationLinkModels(LinkType linkType, RelationLinkFilter filter, string role, string arcrole)Example: [Sample document] <?xml version="1.0" encoding="UTF-8"?> <linkbase ...> <presentationLink xlink:type="extended" xlink:role="http://www.fujitsu.com/xbrl/document1" ...> <loc xlink:type="locator" xlink:href="demo3_balancesheet.xsd#Document" xlink:label="src"/> <loc xlink:type="locator" xlink:href="demo3_balancesheet.xsd#Company" xlink:label="dest"/> <presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="src" xlink:to="dest" .../> ... </presentationLink> <presentationLink xlink:type="extended" xlink:role="http://www.fujitsu.com/xbrl/document2" ...> <loc xlink:type="locator" xlink:href="demo3_balancesheet.xsd#Document"
34
xlink:label="src"/> <loc xlink:type="locator" xlink:href="demo3_balancesheet.xsd#Title" xlink:label="dest"/> <presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="src" xlink:to="dest" .../> ... </presentationLink> ... [Sample program] PresentationLink rootLink = (PresentationLink)taxonomySet.getRootPresentationLinks(null, "http://www.fujitsu.com/xbrl/document1", null).get(0); RelationLinkModel childModel0 = (RelationLinkModel)rootLink.getChildModels(null, "http://www.fujitsu.com/xbrl/document1", null).get(0); RelationLinkModel childModel1 = (RelationLinkModel)rootLink.getChildModels(null, "http://www.fujitsu.com/xbrl/document1", null).get(1); -> IndexOutOfBoundsException [Results] childModel0.ParentRelationLink.Anchor : XBRL element "Document" childModel0.ChildRelationLink.Anchor : XBRL element "Company"
Use the method below if you want to get root and child node information grouped separately for each extended link role. If you need to follow all the links for each extended link role, this enables
faster processing than repeatedly calling TaxonomySet.getRoot~Links() or RelationLink.getChildModels(). Information can also be obtained concerning the extended link
roles that exist in a link.
Method TaxonomySet.getRelationLinkMap(LinkType linkType) Example: [Sample program] RelationLinkMap map = taxonomySet.getRelationLinkMap(LinkType.LINK_TYPE_PRESENTATION); IEnumerator roles = map.Roles; while (roles.MoveNext()) { string role = (string)roles.Current; RelationLink rootLink = (RelationLink)map.getRootRelationLinks(role).get(0); RelationLinkModel childModel = (RelationLinkModel)map.getChildModels(role, rootLink).get(0); ...(Getting recursive child nodes, and so on)... }
Referencing an element that becomes an anchor To reference the element that becomes a link anchor, do as follows:
Property RelationLink.Anchor Example: [Sample document] <?xml version="1.0" encoding="UTF-8"?> <linkbase ...> <presentationLink xlink:type="extended" ...> <loc xlink:type="locator" xlink:href="demo3_balancesheet.xsd#Document" ... [Sample program] ElementDecl element = (ElementDecl)rootLink.Anchor; [Results] element.Id : Document
35
Referencing link information
A relation link represents the relationships between elements as link information. Examples of
important attributes in the relationships are the order attribute for each link and the weight attribute for calculation links. The figure below shows the procedure for obtaining the order attribute.
Property Arc.Order CalculationArc.Weight PresentationArc.PreferredLabel Example: Obtain the order attribute of a presentation link. LinkInformation linkInfo = rootPresentationLink.getLinkInformationList(childLink0).get(0); Arc arc = linkInfo.Arc; if(arc.ArcType == LinkType.LINK_TYPE_PRESENTATION){ PresentationArc presArc = (PresentationArc)arc; double order = presArc.Order; }
Referencing a link model The procedure for getting links and link information from a link model is shown below:
Property LinkModel.LinkInformation RelationLinkModel.ParentRelationLink RelationLinkModel.ChildRelationLink Example: Get the parent and child of a presentation link. RelationLink parentLink = childModel0.ParentRelationLink; RelationLink childLink = childModel0.ChildRelationLink; LinkInformation linkInfo = childModel0.LinkInformation;
4.3.4 Referencing a resource link
To reference the resource specified for an XBRL element, reference the link and the XBRL element before
obtaining the resource assigned to the XBRL element (anchor) from the referenced link. Use the same procedure to refer to the resource assigned to an item (anchor).
Referring to a link The XBRL processor assumes that TaxonomySet or Instance has one resource link node entity. The
label, reference, and footnote links can be referenced with the corresponding methods.
Property TaxonomySet.LabelLink TaxonomySet.ReferenceLink Instance.FootnoteLink Example: LabelLink labelLink = taxonomySet.LabelLink; ReferenceLink refLink = taxonomySet.ReferenceLink; FootnoteLink footLink = instance.FootnoteLink;
Referencing resources
Link is referenced for resources allocated to elements. These elements are assumed to have already been obtained individually as a variable name element or item.
Method LabelLink.getResources(Anchor element) ReferenceLink.getResources(Anchor element) FootnoteLink.getResources(Anchor item)
36
Example: Label label = (Lable)labelLink.getResources(element).get(0);
When you want to get the resources according to its extended link role or arcrole, specify the
extended link role or arcrole to get the resources.
Method LabelLink.getResourceModels(Anchor anchor, ResourceLinkFilter filter, string role, string arcrole) ReferenceLink.getResourceModels(Anchor anchor, ResourceLinkFilter filter, string role, string arcrole) FootnoteLink. getResourceModels(Anchor anchor, ResourceLinkFilter filter, string role, string arcrole) ElementDecl.getResourceLinkModels(LinkType linkType, ResourceLinkFilter filter, string role, string arcrole) ElementDecl.getResourceLinkModels(LinkType linkType, ResourceLinkFilter filter, string role, string arcrole, string resRole, string lang) Example: ResourceLinkModel label = (ResourceLinkModel)labelLink.getResourceModels(element, null, "http://www.fujitsu.com/xbrl/document1" ,null).get(0); Label label = (Label)labelModel.getResource();
Using resources
Resource information (value and language attribute) is obtained from the resource class.
Property Label.LabelElements Label.LabelElementsAsString Label.Language Example: Obtain labels written in Japanese. [Sample document] <label xlink:type="resource" xlink:label="label" xml:lang="ja">Syamei</label> [Sample program] if(...){ string labelValue = label.LabelElementsAsString; // Reference to the label value string lang = label.Language; // Reference to label language attribute } [Results] labelValue : Syamei lang : ja
Referencing link model Link and LinkInformation are obtained from the link model.
Method LinkModel.LinkInformation ResourceLinkModel.ResourceLink ResourceLinkModel.Anchor ResourceLinkModel.Resource Example: Obtain label and anchor. ElementDecl element = (ElementDecl)labelModel.Anchor; Label label = (Label)labelModel.Resource; LinkInformation linkInfo = labelModel.LinkInformation;
4.3.5 Executing calculations and referencing calculation results via calculation links
As explained in a previous section, calculation results can be referenced via a calculation
37
link by using the getCalculatedValue method of a numeric item (NumericItem). Calculation values can be calculated automatically with the following procedure:
Method NumericItem.calculate() NumericItem.calculate(RoundingMode roundingMode) NumericItem.calculate(string role) NumericItem.calculate(string role, RoundingMode roundingMode) NumericItem.calculate(string role, CaliculationOption option)
Calculations are automatically made according to the calculation rules specified in the XBRL2.1
Specification. Calculations are also automatically made for the calculation child and descendant items of the item for which the calculate method was executed. Some calculation rules can be
changed by specifying CalculationOption.
4.3.6 Referencing links where overriding is resolved
The XBRL Processor provides two types of procedures: One is a reference procedure that resolves the overriding of links; the other is a reference procedure that does not resolve the overriding of links. The method that resolves overriding is shown below. Refer to Section 5.4, "Overriding Links", for details of the overriding of links.
Method that resolves overriding of link information RelationLink.getResolvedLinkInformationList(RelationLink child, string role, string arcrole)
ResourceLink.getResolvedLinkInformationList(Anchor anchor, Resource resource,
string role, string arcrole)
Method that uses filters to resolve overriding RelationLink.getChildModels(RelationLinkFilter filter, string role, string arcrole)
RelationLink.getParentModels(RelationLinkFilter filter, string role, string arcrole)
RelationLink.getRelationLinkByAnchor(Anchor anchor, RelationLinkFilter filter,
string role, string arcrole)
ResourceLink.getResourceModels(Anchor anchor, ResourceLinkFilter filter,
string role, string arcrole)
ElementDecl.getChildRelationLinkModels(LinkType linkType, RelationLinkFilter filter,
string role, string arcrole)
ElementDecl.getResourceLinkModels(short linkType, ResourceLinkFilter filter,
string role, string arcrole, string resRole, string lang)
UserElement.getResourceLinkModels(short linkType, ResourceLinkFilter filter,
string role, string arcrole, string resRole, string lang)
Appendix B, "Samples of Overridden Documents"", contains actual examples of referencing an XBRL document that contains overriding. Refer to the examples.
38
Chapter 5 Modifying with XBRL Data Models
Information about XBRL documents can be changed by manipulating elements of the corresponding XBRL
data model. Changes to an XBRL data model are classified into the following three categories:
1) Adding a new element 2) Changing the contents of an existing element
3) Deleting an existing element
5.1 Adding a New Element
In an XBRL data model, objects that contain individual elements basically provide setting and addition
methods for these sub-elements. Each created element also provides a setting method for itself. The figure below shows the basic workflow for adding new elements to an XBRL data model.
:User application :A
createB()
High-order element
:B Low-order element setAny()
setB()
Figure 12 Basic workflow for adding new elements to an XBRL data model
For example, the Identifier of an instance document, which is a sub-element as viewed from ContextEntity,
can be created and set as follows: 1) Create an Identifier instance using Instance.createIdentifier() or Instance.createIdentifier(string value,
string scheme). 2) Specify the setting of the Identifier instance created in step 1), by calling setScheme(string scheme)
or setValue(string value). 3) Using ContextEntity.setIdentifier(Identifier identifier), specify the Identifier instance set up in step 2)
to be a ContextEntity instance.
39
5.2 Changing the Contents of an Existing Element
To change a specific item in an XBRL document, change the settings of elements in the corresponding XBRL data model. For example, to change the value of the balance attribute of an item definition element,
use the following method from the applicable ElementDecl instance to change the settings: ElementDecl.setBalance(string balance)
5.3 Deleting an Existing Element
To delete a specific element from an XBRL document, delete an element in the corresponding XBRL data model. For example, to delete the "element" element in a schema, delete the corresponding ElementDecl
instance from its upper-level element XMLSchema instance, using the following method: XMLSchema.removeElementDecl(ElementDecl element)
40
5.4 Overriding Links
Link overriding is implemented by adding a new structural element, rather than by deleting an existing structural element or mofidying its contents. The following sections give an overview and describe the procedure.
5.4.1 Link overriding
In an XBRL document, different types of link information can be assigned to a single link. It is also possible to define multiple links that are assumed to be identical to one another. These definitions are not
restricted to the same document. Links and link information can be assigned for different documents. Based on the above specifications, once links are created, they can be replaced without deletion or
modification of their contents. This function is referred to as "override". The override function enables flexible extension of XBRL documents. For example, link information contains information such as
whether link traversal is enabled, the element presentation order, and accrual weight used for item calculations. The presentation order and accrual weight can be changed according to the situation in which
XBRL documents are used. Two steps, link deletion and link addition, are required to override a link.
Link 1: Defined in base taxonomy
Links 2 and 3: Defined in extended taxonomy
* Link overriding causes order=1 to become order=3.
XBRL element <A/> XBRL element <B/>
Link informatio
Link 1 (order=1)
Link 2 (deletes Link 1)
Link 3 (order=3)
Figure 13 Overriding of the link information
5.4.2 Creating a process for overriding
The following shows an example of creating a process for the overriding of information in an XBRL
processor data model:
Example: Create a process of overriding. //Call the link to be overridden. RelationLink parentLink = (RelationLink)taxonomySet.RootPresentationLinks.get(0); RelationLinkModel oldChildModel = (RelationLinkModel)parentLink.getChildModels( RelationLink_Fields.FILTER_RESOLVING, null, null).get(0); RelationLink childLink = oldChildModel.ChildRelationLink; LinkInformation oldLinkInfo = oldChildModel.LinkInformation; Arc oldArc = oldLinkInfo.Arc; //Create the XLink declaration information of the link. Linkbase linkbase = (Linkbase)schema.getLinkbases(LinkType.LINK_TYPE_PRESENTATION).get(0); XLinkDecl xDecl = linkbase.createXLinkDecl();
41
linkbase.addXLinkDecl(xDecl); //Create the link information that deletes the existing link. LinkInformation proLinkInfo = oldLinkInfo.clone(xDecl); proLinkInfo.Arc.Priority = oldArc.Priority + 1; proLinkInfo.Arc.Use = Arc_Fields.USE_PROHIBITED; proLinkInfo.SrcLocator.Label = "src1"; proLinkInfo.DestLocator.Label = "dest1"; //Register the link information xDecl.addLinkInformation(proLinkInfo); parentLink.addLinkInformation(childLink, proLinkInfo); //Create the link information that raises the order of the existing link. LinkInformation oveLinkInfo = oldLinkInfo.clone(xDecl); oveLinkInfo.Arc.Priority = oldArc.Priority + 2; oveLinkInfo.Arc.Order = oldArc.Order + 1; oveLinkInfo.SrcLocator.Label = "src2"; oveLinkInfo.DestLocator.Label = "dest2"; //Register the link information xDecl.addLinkInformation(oveLinkInfo); parentLink.addLinkInformation(childLink, oveLinkInfo);
Overriding can also be implemented as shown below:
Example: Create a process of overriding. //Call the link to be overridden. RelationLink parentLink = (RelationLink)taxonomySet.RootPresentationLinks.get(0); RelationLinkModel oldChildModel = (RelationLinkModel)parentLink.getChildModels( RelationLink_Fields.FILTER_RESOLVING, null, null).get(0); ElementDecl pElem = (ElementDecl)oldChildModel.ParentRelationLink.Anchor; ElementDecl cElem = (ElementDecl)oldChildModel.ChildRelationLink.Anchor; Arc oldArc = oldChildModel.LinkInformation.Arc; //Create the XLink declaration information of the link. Linkbase linkbase = (Linkbase)schema.getLinkbases(LinkType.LINK_TYPE_PRESENTATION).get(0); XLinkDecl xDecl = linkbase.createXLinkDecl(); linkbase.addXLinkDecl(xDecl); //Delete the existing link. oldChildModel.prohibitLink(xDecl); //Create and add the link that is the existing link with its order raised. RelationLinkModel childModel = pElem.addChild(LinkType.LINK_TYPE_PRESENTATION, cElem, xDecl, oldArc.Arcrole); LinkInformation oveLinkInfo = childModel.LinkInformation; oveLinkInfo.Arc.Order = oldArc.Order + 1;
Note that link deletion and link addition are both necessary in order to override a link.
42
Chapter 6 Tutorial
This chapter explains how to use the XBRL processor by providing detailed examples:
1) Creating new TaxonomySet 2) Adding a schema to TaxonomySet
3) Importing xbrl-instance.xsd 4) Adding an "element" element to a schema
5) Adding a link to linkbase 6) Creating an instance and adding an item
7) Saving an XBRL document
6.1 Creating a new TaxonomySet
In this step, we create a new TaxonomySet using the XBRL processor. The following creates a
TaxonomySet that has no information:
XBRLProcessor xbrlProc = new XBRLProcessor(); //Create new TaxonomySet. TaxonomySet taxonomySet = xbrlProc.newTaxonomySet();
6.2 Adding a Schema
Here, a schema (XMLSchema) is added to the TaxonomySet according to the following procedure: 1) Creation with the TaxonomySet
2) Making the required settings effective 3) Addition to the TaxonomySet
//Create and specify a schema. XMLSchema schema = taxonomySet.createXMLSchema(); schema.SystemId = xsSysId; schema.TargetNamespace = "http://www.fujitsu.com/xbrl/sample"; schema.putNamespacePrefix("http://www.fujitsu.com/xbrl/sample", "fj"); schema.UserAttrs.setAttribute("", "elementFormDefault", "qualified"); taxonomySet.addPrimarySchema(schema);
6.3 Importing xbrl-instance.xsd
xbrl-instance.xsd needs to be directly or indirectly imported into a taxonomy schema contained in TaxonomySet.
//Import xbrl-instance.xsd. try { schema.addBaseSchema(xbrlProc. getXBRLInstanceSchema(taxonomySet)); } catch (Exception e) { }
43
6.4 Adding an "Element" Element
In this step, we add an "element" element to a schema. Here, an element declaration of the item to be used for an instance is added.
//Add an "element" element. ElementDecl element = schema.createElementDecl(); element.Id = "sample_id"; element.Name = "sample_name"; element.PeriodType = ElementDeclType.PERIOD_TYPE_INSTANT; element.setType(ElementDeclType.XBRL_INSTANCE_NS_URI, ElementDecl_Fields.TYPE_MONETARY_ITEM); element.setSubstitutionGroup(ElementDeclType.XBRL_INSTANCE_NS_URI, ElementDecl_Fields.SUB_GROUP_ITEM); schema.addElementDecl(element); ElementDecl element2 = schema.createElementDecl(); element2.Id = "sample_id2"; element2.Name = "sample_name2"; element2.PeriodType = ElementDecl_Fields.PERIOD_TYPE_INSTANT; element2.setType(ElementDeclType.XBRL_INSTANCE_NS_URI, ElementDecl_Fields.TYPE_MONETARY_ITEM); element2.setSubstitutionGroup(ElementDeclType.XBRL_INSTANCE_NS_URI, ElementDecl_Fields.SUB_GROUP_ITEM); schema.addElementDecl(element2);
6.5 Adding a Link
Add a link.
The procedure for adding a relation link differs from that for adding a resource link. For the relation link, the registration procedure differs between the root link and sublinks. If only the root link exists, creation
of the link entity is omitted.
6.5.1 Adding a relation link
//Add a link. //Register a presentation link reference. Linkbase linkbase = taxonomySet.createLinkbase(); linkbase.SystemId = "link_presentaion.xml"; schema.addLinkbase(LinkType.LINK_TYPE_PRESENTATION, linkbase); //Create a link. PresentationLink pLink = taxonomySet.createPresentationLink(); //Specify an element in the link node. pLink.ElementDecl = element; //Register the link as the root. taxonomySet.addRootPresentationLink(pLink); //Create link containing a link registration element. PresentationLink childLink = taxonomySet.createPresentationLink(); childLink.ElementDecl = element2; pLink.addChild(childLink); XLinkDecl xDecl = linkbase.createXLinkDecl(); linkbase.addXLinkDecl(xDecl); PresentationArc arc = xDecl.createPresentationArc(); arc.Arcrole = PresentationArc_Fields.ARCROLE_PARENT_CHILD; arc.Order = 10; Locator srcLoc = xDecl.createPresentationLocator();
44
srcLoc.Label = "src"; Locator destLoc = xDecl.createPresentationLocator(); destLoc.Label = "dest"; LinkInformation linkInformation = xDecl.createLinkInformation(srcLoc, destLoc, arc); xDecl.addLinkInformation(linkInformation); pLink.addLinkInformation(childLink, linkInformation);
6.5.2 Adding a resource link
//Register a label link reference. Linkbase linkbase2 = taxonomySet.createLinkbase(); linkbase2.SystemId = "link_label.xml"; schema.addLinkbase(LinkType.LINK_TYPE_LABEL, linkbase2); LabelLink lLink = taxonomySet.LabelLink; //Create a label resource. Label label = taxonomySet.createLabel(); label.Language = "ja"; label.LabelElementsAsString = " TEST "; //Add the link destination resource to link. lLink.addLabel(element, label); //Create link information. XLinkDecl xDecl2 = linkbase2.createXLinkDecl(); linkbase2.addXLinkDecl(xDecl2); LabelArc arc2 = xDecl2.createLabelArc(); arc2.Arcrole = LabelArc_Fields.ARCROLE_CONCEPT_LABEL; Locator srcLoc2 = xDecl2.createLabelLocator(); srcLoc2.Label = "element"; Locator destLoc2 = xDecl2.createLabelLocator(); destLoc2.Label = "label"; destLoc2.Role = LabelLocator_Fields.ROLE_LABEL; LinkInformation linkInformation2 = xDecl2.createLinkInformation(srcLoc2, destLoc2, arc2); xDecl2.addLinkInformation(linkInformation2); //Register link information. lLink.addLinkInformation(element, label, linkInformation2);
6.6 Creating an Instance and Adding an Item
1) Creating an instance Here, we create an instance using the TaxonomySet as a basis. A prefix needs to be registered for
the namespace URI used in an instance document.
//Create and specify an instance. Instance instance = null; try { instance = xbrlProc.newInstance(taxonomySet); } catch (XBRLProcessorException e) { Console.Error.WriteLine("creation error: " + e.Message); } instance.SystemId = insSysId; //Register a prefix. instance.putNamespacePrefix("http://www.fujitsu.com/xbrl/sample", "fj"); instance.putNamespacePrefix("http://www.xbrl.org/2003/iso4217", "ISO4217");
45
2) Adding an item We add an item to the instance. To do so, we create the item using as a basis the element
declaration defined in the schema.
//Add an item. NumericItem nItem = instance.createNumericItem(element); instance.addChild(nItem);
3) Adding item information
Here, item information is added. At this point, we add the items listed below to the location immediately following the root element of
the instance document. Item value: 100
Significant figure: 18 digits Unit: ISO4217:JPY
Date: December 14, 2001 Entity: "SAMPLE" based on scheme "http://www.fujitsu.com/xbrl/sample"
//Add values. Context context = instance.createContext(); context.Id = "i1"; ContextEntity entity = instance.createContextEntity(); Identifier identifier = instance.createIdentifier(); identifier.Value = "SAMPLE"; identifier.Scheme = "http://www.fujitsu.com/xbrl/sample"; entity.Identifier = identifier; context.Entity = entity; Instant instant = instance.createInstant(); instant.Date = "2001-12-14"; context.Period = instant; instance.addContext(context); Multiply unit = instance.createMultiply(); unit.Id = "u1"; Measure measure = instance.createMeasure(); measure.setValue("http://www.xbrl.org/2003/iso4217", "JPY"); unit.addMeasure(measure); instance.addUnit(unit); nItem.SpecifiedValue = "100"; nItem.Context = context; nItem.Unit = unit; nItem.Precision = "18";
46
6.7 Saving XBRL Documents
Here, we save schemas, linkbase, and instance documents.
//Save taxonomies and instance documents. try{ xbrlProc.saveXMLSchema(schema, null); xbrlProc.saveLinkbase(linkbase, null); xbrlProc.saveLinkbase(linkbase2, null); xbrlProc.saveInstance(instance, null); } catch (System.Xml.XmlException e) { Console.Error.WriteLine("save error: " + e.Message); } catch (XBRLProcessorException e) { Console.Error.WriteLine("save error: " + e.Message); }
We serialize an XBRL data model in preparation for repeated processing of the same instance documents and taxonomies.
//Serialize an XBRL document data model. try{ FileStream outputStream = new FileStream("serialize.dat", FileMode.Create); xbrlProc.serializeTaxonomySet(taxonomySet, outputStream); } catch (Exception e){ Console.Error.WriteLine("save error: " + e.Message); }
For more information, see all relevant source programs and execution results shown in Appendix A, "Tutorial Source Code" in this manual.
47
Chapter 7 Specifications and Restrictions
This chapter explains specifications and restrictions of the XBRL processor. For other related
specifications, see the "XBRL API Reference".
7.1 Handling of Elements by the XBRL Processor
When the XBRL processor handles XBRL documents, it may automatically supplement, modify, ignore or
abandon document information. This is described in greater detail in the subsequent sections. The following table shows the relationship between namespace prefixes and namespace URIs used in the
subsequent sections: Prefix Namespace URI xsd http://www.w3.org/2001/XMLSchema xsi http://www.w3.org/2001/XMLSchema-instance xbrli http://www.xbrl.org/2003/instance link http://www.xbrl.org/2003/linkbase
7.1.1 Elements relating to taxonomies and schemas
1) Elements relating to all taxonomies and schemas (Elements belonging to namespace http://www.w3.org/2001/XMLSchema)
Reading from a file
- User-defined attributes are ignored for elements other than the following elements: xsd:schema element xsd:element element right under the xsd:schema element
link:presentationArc, link:calculationArc, link:definitionArc, link:labelArc, and link:referenceArc elements
link:documentation element xsd:simpleType element, xsd:complexType element.
- Elements other than those listed below cannot be accessed from an XBRL data model. Information is retained and used for validation; however, a user cannot directly acquire and
change that information. These elements are output at schema output. xsd:any element
xsd:group element. 2) xsd:schema element
Reading from a file
- Deletes any white spaces before and after the id attribute value.
- Deletes any white spaces before and after the targetNamespace attribute value. - Deletes any white spaces before and after the xml:base attribute value.
- Deletes any white spaces before and after the xml:lang attribute value. - Deletes any white spaces before and after the xsi:schemaLocation attribute value.
- Returns an error if the targetNamespace attribute of the schema to which another schema refers is not found.
- If the same targetNamespace attribute value is set for multiple schemas whose system identifiers are different, the second and subsequent schemas are integrated into the first-read
schema or the targetNamespace attributes of the second and subsequent schemas which were read are ignored.
Writing to a file
48
- Outputs sub-elements in the order of xsd:annotation element, xsd:import element, xsd:include element, xsd:element element, xsd:attribute element, xsd:simpleType element,
xsd:complexType element, xsd:group element, and other elements.
- Outputs the targetNamespace attribute value after URI encoding.
- Outputs the xml:base attribute value after URI encoding. - Outputs the xsi:schemaLocation attribute value after URI encoding.
3) xsd:element element
Reading from a file
- Deletes any white spaces before and after the abstract attribute value.
- Deletes any white spaces before and after the id attribute value. - Deletes any white spaces before and after the name attribute value.
- Deletes any white spaces before and after the nillable attribute value. - Deletes any white spaces before and after the ref attribute value.
- Deletes any white spaces before and after the substitutionGroup attribute value. - Deletes any white spaces before and after the type attribute value.
- Deletes any white spaces before and after the xbrli:balance attribute value. - Deletes any white spaces before and after the xbrli:periodType attribute value.
- Returns an error if the name attribute is not found. - Returns an error if the namespace does not exist in the type attribute value.
- Returns an error if the namespace does not exist in the substitutionGroup attribute value. Writing to a file
- Outputs the namespace declaration attribute values associated with the type attribute, substitutionGroup attribute and ref attribute values (QName) after URI encoding.
4) xsd:attribute element
Reading from a file
- Deletes any white spaces before and after the default attribute value.
- Deletes any white spaces before and after the fixed attribute value. - Deletes any white spaces before and after the form attribute value.
- Deletes any white spaces before and after the name attribute value. - Deletes any white spaces before and after the ref attribute value.
- Deletes any white spaces before and after the type attribute value. - Deletes any white spaces before and after the use attribute value.
- Ignores the xsd:annotation element. Writing to a file
- Outputs namespace declaration attribute values associated with the type attribute and ref attribute values (QName) after URI encoding.
5) xsd:anyAttribute element
Reading from a file
- Deletes any white spaces before and after the namespace attribute value.
- Deletes any white spaces before and after the processContents attribute value. - Ignores the xsd:annotation element.
6) xsd:simpleType element
Reading from a file
- Ignores the xsd:annotation element, xsd:list element, and xsd:union element.
49
7) xsd:simpleContent element
Reading from a file
- Ignores the xsd:annotation element. 8) xsd:complexContent element
Reading from a file
- Ignores the xsd:annotation element. 9) xsd:restriction element
Reading from a file
- Deletes any white spaces before and after the base attribute value.
- Ignores the xsd:annotation, and xsd:attributeGroup elements. Writing to a file
- Outputs the namespace declaration attribute values associated with the base attribute values (QName) after URI encoding.
- If the base attribute does not exist in the xsd:restriction element right under the xsd:complexContent element, the xsd:restriction element is not output and a model group is
output to the location right under the xsd:complexContent element. This operation can be changed by property setting (XBRLProperties_Fields.OUTPUT_VERBOSE_XML) for
XBRLProcessor. 10) xsd:annotation element
Reading from a file
- Ignores the elements having the link:linkbaseRef element as their sub-element and the elements existing right under the global element declaration.
Writing to a file
- Outputs the elements having the link:linkbaseRef element as their sub-element and the elements existing right under the global element declaration.
11) xsd:appinfo element
Reading from a file
- Ignores the elements other than those having the link:linkbaseRef element as their sub-element. Writing to a file
- Outputs only the elements having the link:linkbaseRef element as their sub-elements. 12) xsd:documentation element
Reading from a file
- Deletes any white spaces before and after the xml:lang attribute value.
- Ignores the elements other than those that belong to the xsd:element element as sub-elements.
13) link:roleType element Reading from a file
- Deletes any white spaces before and after the roleURI attribute value.
14) link:arcroleType element Reading from a file
- Deletes any white spaces before and after the arcroleURI attribute value. - Deletes any white spaces before and after the cyclesAllowed attribute value.
50
15) link:usedOn element
Reading from a file
- Deletes any white spaces before and after the link:usedOn element value. Writing to a file
- Outputs the namespace declaration attribute values associated with the link:usedOn element values (QName) after URI encoding.
16) xsd:import element Reading from a file
- Deletes any white spaces before and after the namespace attribute value. - Deletes any white spaces before and after the schemaLocation attribute value.
- Returns an error if the namespace attribute or schemaLocation is not found. - Ignores the xsd:import element if neither the namespace attribute nor schemaLocation is found.
- Returns an error if the namespace specified in the namespace attribute differs from the target namespace of the actual schema.
- Ignores the xsd:annotation element. Writing to a file
- Outputs the namespace attribute value after URI encoding. - Outputs the schemaLocation attribute value after URI encoding.
17) xsd:include element
Reading from a file
- Deletes any white spaces before and after the schemaLocation attribute value.
- Ignores the xsd:annotation element. - Fetches the specified schema and abandons the xsd:include element itself. This operation can
be changed by property setting (XBRLProperties. MERGE_INCLUDED_SCHEMA) for XBRLProcessor.
Writing to a file
- Does not output the xsd:include element. This operation can be changed by property setting (XBRLProperties. MERGE_INCLUDED_SCHEMA) for XBRLProcessor.
18) link:linkbaseRef element Explained later(7.1.4) in this document.
19) xsd:any element, xsd:group element
Reading from a file
- These information is read, but not reflected into XBRL data model.. Writing to a file
- The element is output. 20) Other elements
Reading from a file
- These information is read, but not reflected into XBRL data model. Writing to a file
- Not output. Only elements just under root node are output.
51
7.1.2 Elements relating to linkbases
1) All elements relating to linkbases (Elements belonging to the namespace http://www.xbrl.org/2003/linkbase)
Reading from a file
- Ignores the user-defined attributes excluding the following elements: link:presentationArc, link:calculationArc, link:definitionArc, link:labelArc,
link:referenceArc
link:documentation elements
2) link:linkbase element Reading from a file
- Deletes any white spaces before and after the id attribute value. - Deletes any white spaces before and after the xml:base attribute value.
- Deletes any white spaces before and after the xml:lang attribute value. - Deletes any white spaces before and after the xsi:schemaLocation attribute value. Writing to a file
- Outputs sub-elements in the order of link:documentation element, link:roleRef element, link:arcroleRef element, and extension link declaration element.
- Outputs the xml:base attribute value after URI encoding.
- Outputs the xsi:schemaLocation attribute value after URI encoding.
3) link:presentationLink element, link:calculationLink element, link:definitionLink element, link:labelLink element, and link:referenceLink element
Reading from a file
- Deletes any white spaces before and after the id attribute value.
- Deletes any white spaces before and after the xml:lang attribute value. - Deletes any white spaces before and after the xlink:role attribute value. Writing to a file
- Outputs the xlink:role attribute value after URI encoding. 4) link:presentationArc element, link:calculationArc element, link:definitionArc element, link:labelArc
element, and link:referenceArc element Reading from a file
- Deletes any white spaces before and after the order attribute value. If the value is out of range of double, the value is rounded.
- Deletes any white spaces before and after the preferredLabel attribute value (PresentationArc). - Deletes any white spaces before and after the priority attribute value.
- Deletes any white spaces before and after the use attribute value. - Deletes any white spaces before and after the weight attribute value (CalculationArc).
- Deletes any white spaces before and after the xlink:arcrole attribute value. Writing to a file
- Outputs the arcrole attribute value after URI encoding.
5) link:label element Reading from a file
- Deletes any white spaces before and after the id attribute value. - Deletes any white spaces before and after the xlink:label attribute value.
52
- Deletes any white spaces before and after the xlink:role attribute value. - Deletes any white spaces before and after the xml:lang attribute value. Writing to a file
- Outputs the xlink:role attribute value after URI encoding. 6) link:reference element
Reading from a file
- Deletes any white spaces before and after the id attribute value.
- Deletes any white spaces before and after the xlink:label attribute value. - Deletes any white spaces before and after the xlink:role attribute value.
- Deletes any white spaces before and after the xml:lang attribute value. Writing to a file
- Outputs the xlink:role attribute value after URI encoding.
7) part element None.
8) link:loc element
Reading from a file
- Deletes any white spaces before and after the id attribute value.
- Deletes any white spaces before and after the xlink:label attribute value. - Deletes any white spaces before and after the xlink:role attribute value.
- Abandons the information on the xlink:href attribute value after link analysis (does not retain the information on Full XPointer and Child Sequence information).
Writing to a file
- Uses bare name referencing for all xlink:href attribute values.
- Outputs the xlink:href attribute value after URI encoding. - Outputs the xlink:role attribute value after URI encoding.
- For the xlink:href attribute value, outputs URI of the schema being referenced as a relative URI whenever possible. This operation can be changed by property setting (XBRLProperties.
OUTPUT_RELATIVE_PATH) for XBRLProcessor.
9) title element Reading from a file
- Deletes any white spaces before and after the xml:lang attribute value.
10) link:documentation element Reading from a file
- Deletes any white spaces before and after the xml:lang attribute value.
11) Other elements Reading from a file
- Ignored. Writing to a file
- Not output.
53
7.1.3 Instance-related elements
1) All instance-related elements (Elements belonging to the namespace http://www.xbrl.org/2001/instance)
Reading from a file
- Ignores the user-defined attributes excluding the following elements: link:footnoteArc link:documentation
item and tuple
2) xbrli:xbrl element Reading from a file
- Deletes any white spaces before and after the id attribute value. - Deletes any white spaces before and after the xml:base attribute value.
- Deletes any white spaces before and after the xml:lang attribute value. - Deletes any white spaces before and after the xsi:schemaLocation attribute value. Writing to a file
- Outputs the xml:base attribute value after URI encoding.
- Outputs the xsi:schemaLocation attribute value after URI encoding. - Sub-elements are output in the order of link:schemaRef element, link:linkbaseRef element,
link:roleRef element, link:arcroleRef element, xbrli:context element, xbrli:unit element, items and tuples, and link:footnoteLink element .
3) Items and tuples
Reading from a file
- Deletes any white spaces before and after the contextRef attribute value.
- Deletes any white spaces before and after the decimals attribute value. - Deletes any white spaces before and after the id attribute value.
- Deletes any white spaces before and after the precision attribute value. - Deletes any white spaces before and after the unitRef attribute value.
- Deletes any white spaces before and after the xml:lang attribute value. - Deletes any white spaces before and after the xsi:nil attribute value.
- Makes corrections automatically if the numericContext or nonNumericContext attribute is used for reference to context (posts an error to the error handler).
- Ignores items and tuples not defined in a schema. (Posts an error to the error handler.)
4) link:schemaRef element Reading from a file
- Deletes any white spaces before and after the xlink:actuate attribute value. - Deletes any white spaces before and after the xlink:href attribute value.
- Deletes any white spaces before and after the xlink:role attribute value. - Deletes any white spaces before and after the xlink:show attribute value.
- Deletes any white spaces before and after the xlink:title attribute value. - Deletes any white spaces before and after the xml:lang attribute value. Writing to a file
- Outputs the xlink:href attribute value after URI encoding.
- Outputs the xlink:role attribute value after URI encoding. - For the xlink:href attribute value, outputs the URI of the schema being referenced as a relative
54
URI whenever possible. This operation can be changed by property setting (XBRLProperties_Fields. OUTPUT_RELATIVE_PATH) for XBRLProcessor.
5) link:linkbaseRef element
Explained later(7.1.4) in this document.
6) xbrli:context element Reading from a file
- Deletes any white spaces before and after the id attribute value. Writing to a file
- Sub-elements are output in the order of xbrli:entity element, xbrli:period element, and xbrli:scenario element.
7) xbrli:entity element
Writing to a file
- Sub-elements are output in the order of xbrli:identifier element and xbrli:segment element. 8) xbrli:identifier element
Reading from a file
- Deletes any white spaces before and after the scheme attribute value. Writing to a file
- Outputs the scheme attribute value after URI encoding. 9) xbrli:segment element
None.
10) xbrli:period element None.
11) xbrli:period sub-elements
None.
12) xbrli:unit element Reading from a file
- Deletes any white spaces before and after the id attribute value.
13) xbrli:measure element Writing to a file
- Outputs the namespace declaration attribute value associated with the xbrli:measure element value (QName) after URI encoding.
14) Other xbrli:unit sub-elements
None
15) xbrli:scenario element None.
16) link:footnoteLink element
55
Reading from a file
- Deletes any white spaces before and after the id attribute value.
- Deletes any white spaces before and after the xml:lang attribute value. - Deletes any white spaces before and after the xlink:role attribute value. Writing to a file
- Adds link as the namespace prefix.
- Outputs the xlink:role attribute value after URI encoding.
17) link:footnoteArc element Reading from a file
- Deletes any white spaces before and after the order attribute value. If the value is out of range of double, the value is rounded.
- Deletes any white spaces before and after the priority attribute value. - Deletes any white spaces before and after the use attribute value.
- Deletes any white spaces before and after the xlink:arcrole attribute value. Writing to a file
- Adds link as the namespace prefix. - Outputs the xlink:arcrole attribute value after URI encoding.
18) link:footnote element
Reading from a file
- Deletes any white spaces before and after the id attribute value.
- Deletes any white spaces before and after the xlink:label attribute value. - Deletes any white spaces before and after the xlink:role attribute value.
- Deletes any white spaces before and after the xml:lang attribute value. Writing to a file
- Adds link as the namespace prefix. - Outputs the xlink:role attribute value after URI encoding.
19) link:loc element
Reading from a file
- Deletes any white spaces before and after the id attribute value.
- Deletes any white spaces before and after the xlink:label attribute value. - Deletes any white spaces before and after the xlink:role attribute value.
- Abandons the xlink:href attribute value information after link analysis (Full XPointer and Child Sequence information is not retained.)
Writing to a file
- Adds link as the namespace prefix.
- Uses the bare name referencing for all xlink:href attributes. - Outputs the xlink:href attribute value after URI encoding.
- Outputs the xlink:role attribute value after URI encoding. - For the xlink:href attribute value, outputs the URI of the instance being referenced as a relative
URI whenever possible. This operation can be changed by property setting (XBRLProperties_Fields. OUTPUT_RELATIVE_PATH) for XBRLProcessor.
20) Other elements
Reading from a file
- Ignored.
56
Writing to a file
- Not output.
7.1.4 Common elements
1) link:linkbaseRef element
Reading from a file
- Deletes any white spaces before and after the xlink:actuate attribute value.
- Deletes any white spaces before and after the xlink:arcrole attribute value. - Deletes any white spaces before and after the xlink:href attribute value.
- Deletes any white spaces before and after the xlink:role attribute value. - Deletes any white spaces before and after the xlink:show attribute value.
- Deletes any white spaces before and after the xlink:title attribute value. - Deletes any white spaces before and after the xml:lang attribute value.
- If the same linkbase is being referenced with multiple link:linkbaseRef elements (having the same role attribute value), ignores the link:linkbaseRef elements other than the one first
analyzed. Writing to a file
- Outputs the link:linkbaseRef elements in the order of presentation link, calculation link, definition link, label link, and reference link.
- Outputs the xlink:href attribute value after URI encoding. - Outputs the xlink:role attribute value after URI encoding.
- For the xlink:href attribute value, outputs the URI of the schema being referenced as a relative URI. This operation can be changed by property setting (XBRLProperties_Fields.
OUTPUT_RELATIVE_PATH) for XBRLProcessor.
2) link:roleRef element Reading from a file
- Abandons the xlink:href attribute value after link analysis (neither Full XPointer nor Child Sequence information is retained).
Writing to a file
- Outputs the xlink:href attribute value after URI encoding.
- For the xlink:href attribute value, outputs the URI of the schema being referenced as a relative URI. This operation can be changed by property setting (XBRLProperties_Fields.
OUTPUT_RELATIVE_PATH) for XBRLProcessor.
3) link:arcroleRef element Reading from a file
- Abandons the xlink:href attribute value information after link analysis (Full XPointer and Child Sequence information is not retained).
Writing to a file
- Outputs the xlink:href attribute value after URI encoding.
- For the xlink:href attribute value, outputs the URL of the schema being referenced as a relative URI whenever possible. This operation can be changed by property setting
(XBRLProperties_Fields. OUTPUT_RELATIVE_PATH) for XBRLProcessor.
7.2 Other Specifications
A DOM constructed with parsers that do not recognize a namespace cannot be handled.
57
The maximum number of objects that can be added with the add or insert method is the same as the maximum number which ArrayList method allow.
58
7.3 Restrictions
Changing method like setter/add for XBRL data model is not thread-safe. The schemes supported as system identifiers are file and http.
Only canonicalized system identifiers can be specified. Operation is not assured if a system identifier is specified that has not been canonicalized.
Example: Acceptable: http://www.foo.com/c
Unacceptable: http://www.foo.com/d/../c Any file having "#" in its path cannot be read properly.
For the following methods of an XBRL data model, the differences among the order attribute, weight attribute, preferredLabel attribute, and user-defined attributes of an arc are not considered
during overriding. In other words, even if arcs have different order attributes, for example, they are assumed to be identical and overriding is performed for them.
- RelationLink.getChildren(RelationLinkFilter filter, string role, string arcrole); - RelationLink.getParents(RelationLinkFilter filter, string role, string arcrole);
- RelationLink.getResolvedLinkInformation(RelationLink child, string role, string arcrole);
- RelationLink.getResolvedLinkInformationList(RelationLink child); - ResourceLink.getResources(Anchor anchor, ResourceLinkFilter filter,
string role, string arcrole);
- ResourceLink.getResolvedLinkInformation(Anchor anchor, Resource resource, string role, string arcrole);
- ResourceLink.getResolvedLinkInformationList(Anchor anchor, Resource resource); If, after an instance data model is created, the taxonomy data model that is the basis of that
creation is changed subsequently, instance data model operation is not assured.
If, after an instance data model is created, the a taxonomy data model that is the basis of that creation is changed subsequently, the operation of any instance data model newly created on the
basis of that taxonomy data model is not guaranteed. Operation is not assured if data models coexist that are constructed from different types of
TaxonomySet. Operation is not assured if data models coexist that are constructed from different types of
Instance. Even if the target namespace of a schema has been changed, any attribute value (QName) that is
referencing that namespace is not changed. In other words, a type reference may become invalid.
Even if a structure belonging to a tuple is defined with a schema, whether the instance structure is applicable to that structure definition is not checked. For this reason, a tuple having a
structure not applicable to the schema definition may be output.
7.4 Notes
If the application using the library of this product provides the services on the network like the Net, the application need
to take care about security. For example, this library loads the specified file even if the file is too big. If the application need to limit the file size to be loaded, the application need to manage the file size before the library loads the file.
59
Chapter 8 Changes in API Specifications
8.1 Changes / Differences in API specifications from V1.2
This product supports XBRL 2.1 Errata and has made some changes for the purpose of convenience in the current version. As a result, the following changes in API specifications have been made.
Class Method Change Program
Compatibility Data
Compatibility Note
Fujitsu.XML.XBRL.XWand.Processor.XBRLProcessor loadInstance(Source insSource)
Previous Version: when abstract elements are contained in a content model, it resulted in an error and exception was thrown. Current Version: it does not result in an error.
Exception will not be thrown even when abstract elements are contained in a content model.
There is no influence on the existing valid data. Taxonomies having abstract elements in the content model is now treated as valid.
Errata support.
Previous Version: when any/group elements are contained in a content model, it resulted in an error and exception was thrown. Current Version: it does not result in an error.
Exception will not be thrown even when any/group elements are contained in a content model.
There is no influence on the existing valid data. Taxonomies having any/group elements in the content model is now treated as valid.
Errata support.
Previous Version: when role attribute of linkbaseRef is not defined in roleType, it resulted in an error and exception was thrown. Current Version: it does not result in an error.
Exception will not be thrown even when role attribute of linkbaseRef is not defined in roleType.
There is no influence on the existing valid data. Taxonomies having linkbaseRef elements with role attribute not defined in roleType.
Errata support.
The processor now does not skip reading schema having "http://www.xbrl.org/2003/ref" namespace. This schema is supposed to be accompanied by the taxonomy set in usual cases, and therefore the processor of the current version does not skip reading in the default setting.
If your program presupposes the skipping in the data model handling, you will need to let the program read the schema or change the program in the way that the skipping is explicitly done.
No influence. This is an improvement in view of actual usage in Consortium etc.
loadTaxonomySet(Source xsSource) loadTaxonomySet(Source [] xsSources) loadTaxonomySet(Source [] xsSources, Source [] lbSources) Previous Version: when abstract elements are
contained in a content model, it resulted in an error and exception was thrown. Current Version: it does not result in an error.
Exception will not be thrown even when abstract elements are contained in a content model.
There is no influence on the existing valid data. Taxonomies having abstract elements in the content model is now treated as valid.
Errata support.
Previous Version: when any/group elements are contained in a content model, it resulted in an error and exception was thrown. Current Version: it does not result in an error.
Exception will not be thrown even when any/group elements are contained in a content model.
There is no influence on the existing valid data. Taxonomies having any/group elements in the content model is now treated as valid.
Errata support.
Previous Version: when role attribute of linkbaseRef is not defined in roleType, it resulted in an error and exception was thrown. Current Version: it does not result in an error.
Exception will not be thrown even when role attribute of linkbaseRef is not defined in roleType.
There is no influence on the existing valid data. Taxonomies having linkbaseRef elements with role attribute not defined in roleType.
Errata support.
saveInstance(Instance instance, Result result) The processor of the current version outputs all
attribute values specified when reading the document, even if they are default attribute values.
No influence. File output result with the current version is different from that with the previous version. Please note that there is NO influence on the compatibility as XML data. Moreover, the output wiht current version is more compatible with the input document than with the previous version.
This is an improvement for the purpose of achieving higher compatibility between input and output documents.
60
The processor of the current version saves comments directly under the document root.
No influence. File output result with the current version is different from that with the previous version. Please note that there is NO influence on the compatibility as XML data. Moreover, the output wiht current version is more compatible with the input document than with the previous version.
This is an improvement for the purpose of achieving higher compatibility between input and output documents.
The processor of the current version outputs prefixes specified when reading the document as they are (i.e. outputs untouched).
No influence. File output result with the current version is different from that with the previous version. Please note that there is NO influence on the compatibility as XML data. Moreover, the output wiht current version is more compatible with the input document than with the previous version.
This is an improvement for the purpose of achieving higher compatibility between input and output documents.
saveTaxonomy(XMLSchema schema) saveXMLSchema(XMLSchema schema, Result result) Previous Version: when abstract elements are
contained in a content model, it resulted in an error and exception was thrown. Current Version: it does not result in an error.
Exception will not be thrown even when abstract elements are contained in a content model.
There is no influence on the existing valid data. Taxonomies having abstract elements in the content model is now treated as valid.
Errata support.
The processor of the current version outputs all attribute values specified when reading the document, even if they are default attribute values.
No influence. File output result with the current version is different from that with the previous version. Please note that there is NO influence on the compatibility as XML data. Moreover, the output wiht current version is more compatible with the input document than with the previous version.
This is an improvement for the purpose of achieving higher compatibility between input and output documents.
The processor of the current version saves and outputs user-defined attributes in type definition.
There is no influence. Note that if your application program has its own implementation of saving / outputting user-defined attributes of type definition, that processing will not be needed now.
File output result with the current version is different from that with the previous version. Please note that there is NO influence on the compatibility as XML data. Moreover, the output wiht current version is more compatible with the input document than with the previous version.
This is an improvement for the purpose of achieving higher compatibility between input and output documents.
The processor of the current version saves comments directly under the document root.
No influence. File output result with the current version is different from that with the previous version. Please note that there is NO influence on the compatibility as XML data. Moreover, the output wiht current version is more compatible with the input document than with the previous version.
This is an improvement for the purpose of achieving higher compatibility between input and output documents.
61
The processor of the current version outputs prefixes specified when reading the document as they are (i.e. outputs untouched).
No influence. File output result with the current version is different from that with the previous version. Please note that there is NO influence on the compatibility as XML data. Moreover, the output wiht current version is more compatible with the input document than with the previous version.
This is an improvement for the purpose of achieving higher compatibility between input and output documents.
saveLinkbase(Linkbase linkbase, Result result) The processor of the current version outputs all
attribute values specified when reading the document, even if they are default attribute values.
No influence. File output result with the current version is different from that with the previous version. Please note that there is NO influence on the compatibility as XML data. Moreover, the output wiht current version is more compatible with the input document than with the previous version.
This is an improvement for the purpose of achieving higher compatibility between input and output documents.
The processor of the current version saves comments directly under the document root.
No influence. File output result with the current version is different from that with the previous version. Please note that there is NO influence on the compatibility as XML data. Moreover, the output wiht current version is more compatible with the input document than with the previous version.
This is an improvement for the purpose of achieving higher compatibility between input and output documents.
The processor of the current version outputs prefixes specified when reading the document as they are (i.e. outputs untouched).
No influence. File output result with the current version is different from that with the previous version. Please note that there is NO influence on the compatibility as XML data. Moreover, the output wiht current version is more compatible with the input document than with the previous version.
This is an improvement for the purpose of achieving higher compatibility between input and output documents.
importTaxonomySet(TaxonomySet taxonomySet, TaxonomySet iTaxonomySet) Previous Version: When different taxonomies
refer to a common taxonomy, the processor threw an exception. Current Version: Exception is not thrown and the reference is shared.
Exception is not thrown with the current version, even when different taxonomies refer to a common taxonomy.
No influence. This is an improvement for the purpose of making usability more convenient.
Fujitsu.XML.XBRL.XWand.Common.RelationLink getChildren(RelationLinkFilter filter, string role, string arcrole);
Changed to "deprecated". Changing to a substitute method is needed.
No influence. Errata support.
getParents(RelationLinkFilter filter, string role, string arcrole); Changed to "deprecated". Changing to a substitute
method is needed. No influence. Errata support.
getResolvedLinkInformation(RelationLink child, string role, string arcrole); Changed to "deprecated". Changing to a substitute
method is needed. No influence. Errata support.
getResolvedLinkInformationList(RelationLink child); Changed to "deprecated". Changing to a substitute
method is needed. No influence. Errata support.
Fujitsu.XML.XBRL.XWand.Common.ResourceLink getResources(Anchor anchor, ResourceLinkFilter filter, string role, string arcrole);
Changed to "deprecated". Changing to a substitute method is needed.
No influence. Errata support.
getResolvedLinkInformation(Anchor anchor, Resource resource, string role, string arcrole);
62
Changed to "deprecated". Changing to a substitute method is needed.
No influence. Errata support.
getResolvedLinkInformationList(Anchor anchor, Resource resource); Changed to "deprecated". Changing to a substitute
method is needed. No influence. Errata support.
Fujitsu.XML.XBRL.XWand.Taxonomy.ElementDecl setSubstitutionGroup(string namespaceURI, string localName);
Previous Version: When trying to change an element with abstract = "true" to a tuple, an exception was thrown as an error. Current Version: it does not result in an error.
There is no need to change your program, simply because it is made possible in the current version to change an element with abstract="true" to a tuple.
No influence. Errata support.
Abstract Property Previous Version: When trying to set "true" value
to abstract attribute, an exception was thrown as an error. Current Version: it does not result in an error.
There is no need to change your program, because it is made possible in the current version to set abstract="true".
No influence. Errata support.
ContentType Property SimpleType Property The processor of the current version throws an
error when schemas of the following two are different: 1 Schema having element declarations 2 Schema having type definitions (anonymous) or attribute declarations (local)
If your application allows these two schemas to be different (which is a breach of XBRL specification), it will raise errors. You need to change the program so that it does not allow such situations.
No influence. This is an improvement to achieve robuster validation.
Fujitsu.XML.XBRL.XWand.Taxonomy.XMLSchema All
The processor of the current version does not allow users to edit imported xbrl-instance.xsd model.
If your program has a process of editing the data model of xbrl-instance.xsd, it will raise errors. The xbrl-instance.xsd is a schema predefined by specification, and thus editing is not allowed. So, if such errors occur, it is a revelation of a potential problem.
No influence. This is an improvement to achieve robuster validation.
Fujitsu.XML.XBRL.XWand.Taxonomy.Contentmodel.ContentType addAttrDecl(AttrDecl attrDecl)
insertAttrDecl(AttrDecl attrDecl, AttrDecl ref); The processor of the current version throws an
error when schemas of the following two are different: 1 Schema having element declarations 2 Schema having type definitions (anonymous) or attribute declarations (local)
If your application allows these two schemas to be different (which is a breach of XBRL specification), it will raise errors. You need to change the program so that it does not allow such situations.
There is no influence on existing valid data.
This is an improvement to achieve robuster validation.
The processor of the current version throws an error when the attribute value of "name" in attribute declaration is already used elsewhere.
It is wrong to specify an already used value as "name" attribute value. Throwing an error is reasonable and wrong programs should be fixed to avoid such a collision of plural names.
There is no influence on existing valid data.
This is an improvement to achieve robuster validation.
Fujitsu.XML.XBRL.XWand.Instance.UserElement UserAttrs Property
In the processor of the current version, the following namespaces cannot be used in tuple. "http://www.xbrl.org/2003/linkbase" "http://www.xbrl.org/2003/XLink" "http://www.w3.org/1999/xlink"
If your program contains these namespaces, it will throw exceptions. It should be modified not to set them.
Data containing these namespaces will be reported as errors.
Errata support.
Nil Property
63
Previous Version: Error was NOT issued when setting nil attribute value in an item which precision/decimals attribute value is set. Current Version: It now results in an error in such a case.
It is a breach of XBRL Specification to do this. It is reasonable to throw an exception in such occations. If your program is doing such setting, it should be fixed not to do this.
There is no influence on existing valid data.
This is an improvement to achieve robuster validation.
Fujitsu.XML.XBRL.XWand.Instance.NumericValue Precision Property
The processor of the current version throws an exception when trying to set an attribute value to an item with nil="true".
It is a breach of XBRL Specification to do this. It is reasonable to throw an exception in such occations. If your program is doing such setting, it should be fixed not to do this.
There is no influence on existing valid data.
This is an improvement to achieve robuster validation.
64
8.2 Changes / Differences in API specifications from V7.0
This product supports XBRL 2.1 Errata and has made some changes for the purpose of convenience in the current version. As a result, the following changes in API specifications have been made.
Class Method Change Program
Compatibility Data
Compatibility Note
Fujitsu.XML.XBRL.XWand.Processor.XBRLEntityResolver resolveInputEntity(string namespace, string sysId)
The namespace argument may become non-null according to the situation when this method is called to xsd:include element.
If your program presupposes the namespace is null, you will need to change the program.
No influence. This is an improvement for convenience.
Fujitsu.XML.XBRL.XWand.Processor.XBRLProcessor All
The processor makes XMLSchema data model of xbrl-instance.xsd.
No influence. No influence. This is an improvement for convenience.
Fujitsu.XML.XBRL.XWand.Processor.XBRLProcessorException WARNING_DERIVING_TYPES_BY_RESTRICTION_NOT_SUPPORTED
WARNING_DERIVING_TYPES_FROM_SIMPLE_TYPE_NOT_SUPPORTED WARNING_UNEXPECTED_XML_SCHEMA_ELEMENT WARNING_LOCAL_ELEMENT_DECL_NOT_SUPPORTED WARNING_ANY_ELEMENT_NOT_SUPPORTED WARNING_GROUP_ELEMENT_NOT_SUPPORTED Changed to "deprecated". No influence. No influence. This is for data
model enhancement.
ERROR_XBRL_INSTANCE_SCHEMA_NOT_IMPORTED
Changed to "deprecated". No influence. No influence. Integrated into other error code.
ERROR_SRC_AND_DEST_LOCATOR_HAVE_SAME_LABEL ERROR_INVALID_UNIT_FOR_PURE_ITEM Changed to "deprecated". No influence. No influence. Errata support. ERROR_NAMESPACE_OF_IMPORT_NOT_SPECIFIED ERROR_LOOP_OF_XML_SCHEMAS_DETECTED Changed to "deprecated". No influence. No influence. This is an
improvement for convenience.
Fujitsu.XML.XBRL.XWand.Common.XBRLDataException
ERROR_LOOP_OF_XML_SCHEMAS_DETECTED
Changed to "deprecated". No influence. No influence. This is an improvement for convenience.
Fujitsu.XML.XBRL.XWand.Common.XBRLDocument
putNamespacePrefix(string namespaceURI, string prefix) Changed the default prefix "xbrll" of
http://www.xbrl.org/2003/linkbase to "link". If your program presupposes the corresponding prefix value is "xbrll", you will need to change the program.
No influence. This is an improvement in view of actual usage in Consortium etc.
Fujitsu.XML.XBRL.XWand.Taxonomy.ElementDecl
UserAttrs Property Changed "ref" to prohibition attribute of setting. If your program uses this method
to set “ref” instead of ElementRef class, you will need to change the program.
No influence. This is an improvement for API consistency and convenience.
Documentations Property addDocumentation(XSDocumentation documentation) insertDocumentation(XSDocumentation documentation, XSDocumentation ref) removeDocumentation(XSDocumentation documentation) Changed to not "deprecated". No influence. No influence. This is for data
model enhancement.
Fujitsu.XML.XBRL.XWand.Taxonomy.XMLSchema
TargetNamespace Property
The processor of the current version requires the target namespace only if the XML schema is referred from the other XML schema.
No influence. No influence. This is an improvement for convenience.
addBaseSchema(XMLSchema schema) insertBaseSchema(XMLSchema schema, XMLSchema ref)
65
Changed to allow the loop of the XML schema reference.
No influence. No influence. This is an improvement for convenience.
Fujitsu.XML.XBRL.XWand.Taxonomy.XSDocumentation Fujitsu.XML.XBRL.XWand.Taxonomy.XSDocumentationList
All Changed to not "deprecated". No influence. No influence. This is for element
declaration enhancement.
Fujitsu.XML.XBRL.XWand.Taxonomy.Role.ArcroleType
Definitions Property addDefinition(Definition definition) insertDefinition(Definition definition, Definition ref) removeDefinition(Definition definition)
Changed to "deprecated". No influence. No influence. This is an improvement for convenience.
addUsedOn(UsedOn usedOn) insertUsedOn(UsedOn usedOn, UsedOn ref) The processor of the current version throws an
error when the usedOn element overlaps. If your application allows the usedOn element overlaps(which is a breach of XBRL specification), it will raise errors. You need to change the program so that it does not allow such situations.
Data containing these usedOn elements will be reported as errors.
Errata support.
Fujitsu.XML.XBRL.XWand.Taxonomy.Role.RoleType
Definitions Property addDefinition(Definition definition) insertDefinition(Definition definition, Definition ref) removeDefinition(Definition definition) Changed to "deprecated". No influence. No influence. This is an
improvement for convenience.
addUsedOn(UsedOn usedOn) insertUsedOn(UsedOn usedOn, UsedOn ref) The processor of the current version throws an
error when the usedOn element overlaps. If your application allows the usedOn element overlaps(which is a breach of XBRL specification), it will raise errors. You need to change the program so that it does not allow such situations.
Data containing these usedOn elements will be reported as errors.
Errata support.
Fujitsu.XML.XBRL.XWand.Instance.NumericItem calculate()
calculate(string role) calculate(int roundingMode) calculate(string role, int roundingMode) Previous Version: When calculation, the
calculation value was given priority. Current Version: When calculation in default, only the value in instance is used. By using CalculationOption class, the above can be changed.
No influence. There is no influence on the existing valid data. For the existing non-valid data, the report on the error might change.
Errata support.
Previous Version: When calculation, an incomplete calculation was ignored. Current Version: When calculation in default, an incomplete calculation is not ignored. By using CalculationOption class, the above can be changed.
No influence. There is no influence on the existing valid data. For the existing non-valid data, the report on the error might change.
Errata support.
66
8.3 Changes / Differences in API specifications from V7.1
This product supports the latest XML Schema specification. As a result, the following changes in API specifications have been made.
Class Method Change Program
Compatibility Data
Compatibility Note
Fujitsu.XML.XBRL.XWand.Processor.XBRLProcessor loadInstance(Source)
loadInstance(TaxonomySet, Source) Compatible XML Schema specification
changed. If your application loads an instance which includes the value of gMonth data type not compatible to "XML Schema Part 2: Datatypes Second Edition", validation error occurs for the value of gMonth data type. As a result, the value is not reflected into the datamodel.
If your application loads an instance which includes the value of gMonth data type not compatible to "XML Schema Part 2: Datatypes Second Edition", validation error occurs
Fujitsu.XML.XBRL.XWand.Instance.Item SpecifiedValue
Compatible XML Schema specification changed.
If your application calls this method with the value of gMonth data type not compatible to "XML Schema Part 2: Datatypes Second Edition", it will raise errors.
If your application calls this method with the value of gMonth data type not compatible to "XML Schema Part 2: Datatypes Second Edition", it will raise errors.
67
8.4 Changes / Differences in API specifications from V9.0
Data validation has been enhanced to match the operating conditions of consortiums and similar. As a result, the following changes in API specifications have been made.
Class Method Change Program
Compatibility Data
Compatibility Note
Fujitsu.XML.XBRL.XWand.Processor.XBRLProcessor
The read process in general
The rules for prefix change processing when a namespace declaration is duplicated changed to the same as for the taxonomy editor. That is, the format has changed from p_1, p_2, etc. to p0,p1.
No influence. The file output results when a namespace prefix is duplicated in a document have changed, but the compatibility as XML data is not affected.
This is an improvement to match tool specifications.
The following changes in context element comparisons: s-equal processing: - ID attribute removed from comparison targets - Elements and attributes compared after trimming x-equal processing: - Element contents compared after trimming
No influence. Depending on the entries under a context element, check results based on calculation links may have changes.
This change is based on discussions with the specifications determining body.
Changed to report an error when the XML contents set for segment/scenario/footnote/label do not match XBRL specifications.
No influence. There is no effect on existing normal data, but a new error is reported for abnormal data.
This is an improvement to achieve more robust validation.
Changed to report an error when the user definition attributes do not match XBRL specifications.
No influence. There is no effect on existing normal data, but a new error is reported for abnormal data.
This is an improvement to achieve more robust validation.
Changed to report an error when the roleURI attribute value of a roleType element or the arcroleURI attribute value of an arcroleType element do not match XBRL specifications (relative URI format).
No influence. There is no effect on existing normal data, but a new error is reported for abnormal data.
This is an improvement to achieve more robust validation.
Changed to report a warning when the following data is completed or changed during data model creation: - schemaLocation attribute completed - Definition completed for import to XML schema - Replacement of duplicated prefix
No influence. There is no effect on existing normal data, but a new warning is reported for abnormal data.
This is an improvement to achieve more robust validation.
Changed to not complete a default namespace declaration that is not in the original document.
No influence. No influence. This is an improvement for convenience.
The save process in general Changed to correct the error and report a
warning when there is an incorrect location entry in an XBRL normative schema coded as the schemaLocation attribute value.
No influence. There is no effect on existing normal data, but a new warning is reported for abnormal data.
This is an improvement for convenience.
Changed to complete the namespace declaration and report a warning when saving data that uses a namespace URI that has no namespace declaration if the namespace is declared somewhere other than in the DTS.
No influence. There is no effect on existing normal data, but previously a fatal error was issued for abnormal data. Now a warning is reported and a fatal error does not occur.
This is an improvement for convenience.
Changed to not delete unused standard namespace declarations from namespace declarations registered using XBRLDocument.putNamespacePrefix().
No influence. No influence. This is an improvement for convenience.
Fujitsu.XML.XBRL.XWand.Processor.XBRLProcessorException
WARNING_SAME_LINKBASE_REFERRED WARNING_SIMPLE_TYPE_IN_RESTRICTION_NOT_SUPPORTED ERROR_BASE_OF_CONTENT_TYPE_NOT_SPECIFIED ERROR_BASE_OF_SIMPLE_TYPE_NOT_SPECIFIED Changed to deprecated. No influence. No influence. This change results
from data model function
68
enhancements. getMessage() issued for MESSAGE type
Path name included in the return value message changed from an absolute path to the relative path when a file read by an application is specified by a relative path.
No influence. No influence. This is an improvement for convenience.
Fujitsu.XML.XBRL.XWand.Instance.Segment Fujitsu.XML.XBRL.XWand.Instance.Scenario Fujitsu.XML.XBRL.XWand.Instance.Footnote Fujitsu.XML.XBRL.XWand.TaxonomyLabel Method that sets DOM node as a value
Changed to report an error when the set XML contents do not match XBRL specifications.
Programs that have settings prohibited under XBRL throw exceptions and therefore must be corrected.
No influence. This is an improvement to achieve robuster validation.
Fujitsu.XML.XBRL.XWand.Taxonomy.ElementDecl Fujitsu.XML.XBRL.XWand.Taxonomy.Contentmodel.DerivedType Fujitsu.XML.XBRL.XWand.Taxonomy.Contentmodel.AttrDecl Method that sets type
Changed to report an error when the reference relation of the type definition does not match the reference relation of the XML schema.
Programs that have incorrect type settings that do not match the reference relation of the XML schema throw exceptions and therefore must be corrected.
No influence. This is an improvement to achieve robuster validation.
Fujitsu.XML.XBRL.XWand.Taxonomy.ElementDecl
ContentType ContentType SimpleType SimpleType setType(string namespaceURI, string localName)
Changed to report an error in the following cases: - Setting a type other than the item type in an item contents model - Setting a type other than the item type in an anonymous type definition - Setting a local attribute other than an id attribute in an item or a tuple
Programs that have settings prohibited under XBRL throw exceptions and therefore must be corrected.
No influence. This is an improvement to achieve robuster validation.
Fujitsu.XML.XBRL.XWand.Common.UserAttrList
setAttribute(string namespaceURI, string localName, string value) setValue(int index, string value)
Changed to report an error when the user definition attribute does not match XBRL specifications.
Programs that have settings prohibited under XBRL throw exceptions and therefore must be corrected.
No influence. This is an improvement to achieve robuster validation.
Fujitsu.XML.XBRL.XWand.Taxonomy.Role.ArcroleType Fujitsu.XML.XBRL.XWand.Taxonomy.Role.RoleType Arcrole attribute value and role attribute value settings
Changed to report an error when the arcroleURI/roleURI attribute value does not match XBRL specifications (relative URI format).
Programs that have settings prohibited under XBRL throw exceptions and therefore must be corrected.
No influence. This is an improvement to achieve robuster validation.
69
Appendix A Tutorial Source Code
--- XBRLSample.cs ---
using System; using System.IO; using Link = Fujitsu.XML.XBRL.XWand.Common.Link; using LinkType = Fujitsu.XML.XBRL.XWand.Common.LinkType; using LinkInformation = Fujitsu.XML.XBRL.XWand.Common.LinkInformation; using Locator = Fujitsu.XML.XBRL.XWand.Common.Locator; using XLinkDecl = Fujitsu.XML.XBRL.XWand.Common.XLinkDecl; using Context = Fujitsu.XML.XBRL.XWand.Instance.Context; using ContextEntity = Fujitsu.XML.XBRL.XWand.Instance.ContextEntity; using Identifier = Fujitsu.XML.XBRL.XWand.Instance.Identifier; using Instance = Fujitsu.XML.XBRL.XWand.Instance.Instance; using Instant = Fujitsu.XML.XBRL.XWand.Instance.Instant; using Measure = Fujitsu.XML.XBRL.XWand.Instance.Measure; using Multiply = Fujitsu.XML.XBRL.XWand.Instance.Multiply; using NumericItem = Fujitsu.XML.XBRL.XWand.Instance.NumericItem; using XBRLProcessor = Fujitsu.XML.XBRL.XWandProcessor.XBRLProcessor; using XBRLProcessorException = Fujitsu.XML.XBRL.XWandProcessor.XBRLProcessorException; using ElementDecl = Fujitsu.XML.XBRL.XWand.Taxonomy.ElementDecl; using ElementDecl_Fields = Fujitsu.XML.XBRL.XWand.Taxonomy.ElementDecl_Fields; using Label = Fujitsu.XML.XBRL.XWand.Taxonomy.Label; using LabelArc = Fujitsu.XML.XBRL.XWand.Taxonomy.LabelArc; using LabelArc_Fields = Fujitsu.XML.XBRL.XWand.Taxonomy.LabelArc_Fields; using LabelLink = Fujitsu.XML.XBRL.XWand.Taxonomy.LabelLink; using LabelLocator_Fields = Fujitsu.XML.XBRL.XWand.Taxonomy.LabelLocator_Fields; using Linkbase = Fujitsu.XML.XBRL.XWand.Taxonomy.Linkbase; using PresentationArc = Fujitsu.XML.XBRL.XWand.Taxonomy.PresentationArc; using PresentationArc_Fields = Fujitsu.XML.XBRL.XWand.Taxonomy.PresentationArc_Fields; using PresentationLink = Fujitsu.XML.XBRL.XWand.Taxonomy.PresentationLink; using TaxonomySet = Fujitsu.XML.XBRL.XWand.Taxonomy.TaxonomySet; using XMLSchema = Fujitsu.XML.XBRL.XWand.Taxonomy.XMLSchema; class XBRLSample { public static void Main() { string xsSysId = "sampleTaxonomy.xsd"; string insSysId = "sampleInstance.xml"; XBRLProcessor xbrlProc = new XBRLProcessor(); //Create new TaxonomySet. TaxonomySet taxonomySet = xbrlProc.newTaxonomySet(); //Create and specify schemas. XMLSchema schema = taxonomySet.createXMLSchema(); schema.SystemId = xsSysId; schema.TargetNamespace = "http://www.fujitsu.com/xbrl/sample"; schema.putNamespacePrefix("http://www.fujitsu.com/xbrl/sample", "fj"); schema.UserAttrs.setAttribute("", "elementFormDefault", "qualified"); taxonomySet.addPrimarySchema(schema); //Import xbrl-instance.xsd. try { schema.addBaseSchema(xbrlProc. getXBRLInstanceSchema(taxonomySet)); } catch (Exception e) { } //Add "element" elements ElementDecl element = schema.createElementDecl();
70
element.Id = "sample_id"; element.Name = "sample_name"; element.PeriodType = ElementDecl_Fields.PERIOD_TYPE_INSTANT; element.setType(ElementDecl_Fields.XBRL_INSTANCE_NS_URI, ElementDecl_Fields.TYPE_MONETARY_ITEM); element.setSubstitutionGroup(ElementDecl_Fields.XBRL_INSTANCE_NS_URI, ElementDecl_Fields.SUB_GROUP_ITEM); schema.addElementDecl(element); ElementDecl element2 = schema.createElementDecl(); element2.Id = "sample_id2"; element2.Name = "sample_name2"; element2.PeriodType = ElementDecl_Fields.PERIOD_TYPE_INSTANT; element2.setType(ElementDecl_Fields.XBRL_INSTANCE_NS_URI, ElementDecl_Fields.TYPE_MONETARY_ITEM); element2.setSubstitutionGroup(ElementDecl_Fields.XBRL_INSTANCE_NS_URI, ElementDecl_Fields.SUB_GROUP_ITEM); schema.addElementDecl(element2); //Add a link. //Register the representation link reference. Linkbase linkbase = taxonomySet.createLinkbase(); linkbase.SystemId = "link_presentaion.xml"; schema.addLinkbase(LinkType.LINK_TYPE_PRESENTATION, linkbase); //Create a link. PresentationLink pLink = taxonomySet.createPresentationLink(); //Specify an element in a link node. pLink.ElementDecl = element; //Register the link as the root. taxonomySet.addRootPresentationLink(pLink); //Create a link containing an element for which a link is to be registered. PresentationLink childLink = taxonomySet.createPresentationLink(); childLink.ElementDecl = element2; pLink.addChild(childLink); XLinkDecl xDecl = linkbase.createXLinkDecl(); linkbase.addXLinkDecl(xDecl); PresentationArc arc = xDecl.createPresentationArc(); arc.Arcrole = PresentationArc_Fields.ARCROLE_PARENT_CHILD; arc.Order = 10; Locator srcLoc = xDecl.createPresentationLocator(); srcLoc.Label = "src"; Locator destLoc = xDecl.createPresentationLocator(); destLoc.Label = "dest"; LinkInformation linkInformation = xDecl.createLinkInformation(srcLoc, destLoc, arc); xDecl.addLinkInformation(linkInformation); pLink.addLinkInformation(childLink, linkInformation); //Register a label link reference. Linkbase linkbase2 = taxonomySet.createLinkbase(); linkbase2.SystemId = "link_label.xml"; schema.addLinkbase(LinkType.LINK_TYPE_LABEL, linkbase2); LabelLink lLink = taxonomySet.LabelLink; //Create a label resource. Label label = taxonomySet.createLabel(); label.Language = "ja"; label.LabelElementsAsString = "TEST"; //Register a link destination resource in the link.
71
lLink.addLabel(element, label); //Create link information. XLinkDecl xDecl2 = linkbase2.createXLinkDecl(); linkbase2.addXLinkDecl(xDecl2); LabelArc arc2 = xDecl2.createLabelArc(); arc2.Arcrole = LabelArc_Fields.ARCROLE_CONCEPT_LABEL; Locator srcLoc2 = xDecl2.createLabelLocator(); srcLoc2.Label = "element"; Locator destLoc2 = xDecl2.createLabelLocator(); destLoc2.Label = "label"; destLoc2.Role = LabelLocator_Fields.ROLE_LABEL; LinkInformation linkInformation2 = xDecl2.createLinkInformation(srcLoc2, destLoc2, arc2); xDecl2.addLinkInformation(linkInformation2); //Register link information. lLink.addLinkInformation(element, label, linkInformation2); //Create and specify instance information Instance instance = null; try { instance = xbrlProc.newInstance(taxonomySet); } catch (XBRLProcessorException e) { Console.Error.WriteLine("creation error: " + e.Message); } instance.SystemId = insSysId; //Register a prefix. instance.putNamespacePrefix("http://www.fujitsu.com/xbrl/sample", "fj"); instance.putNamespacePrefix("http://www.xbrl.org/2003/iso4217", "ISO4217"); // Add contexts Context context = instance.createContext(); context.Id = "i1"; ContextEntity entity = instance.createContextEntity(); Identifier identifier = instance.createIdentifier("SAMPLE", "http://www.fujitsu.com/xbrl/sample"); entity.Identifier = identifier; context.Entity = entity; Instant instant = instance.createInstant("2001-12-14"); context.Period = instant; instance.addContext(context); // Add units Multiply unit = instance.createMultiply(); unit.Id = "u1"; Measure measure = instance.createMeasure("http://www.xbrl.org/2003/iso4217", "JPY"); unit.addMeasure(measure); instance.addUnit(unit); //Add items. NumericItem nItem = instance.createNumericItem(element, context, unit, "100"); nItem.Precision = "18"; instance.addChild(nItem); //Save taxonomies and instance documents. try { xbrlProc.saveXMLSchema(schema, null); xbrlProc.saveLinkbase(linkbase, null);
72
xbrlProc.saveLinkbase(linkbase2, null); xbrlProc.saveInstance(instance, null); } catch (System.Xml.XmlException e) { Console.Error.WriteLine("save error: " + e.Message); } catch (XBRLProcessorException e) { Console.Error.WriteLine("save error: " + e.Message); } //Serialize the XBRL document data model. try { FileStream outputStream = new FileStream("serialize.dat", FileMode.Create); xbrlProc.serializeTaxonomySet(taxonomySet, outputStream); } catch (Exception e) { Console.Error.WriteLine("save error: " + e.Message); } } }
73
Execution results --- Taxonomy: sampleTaxonomy.xsd ---
<?xml version="1.0" ?> <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:fj=http://www.fujitsu.com/xbrl/sample elementFormDefault="qualified" targetNamespace="http://www.fujitsu.com/xbrl/sample"> <annotation> <appinfo> <link:linkbaseRef xlink:type="simple" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="link_presentaion.xml" xlink:role="http://www.xbrl.org/2003/role/presentationLinkbaseRef"/> <link:linkbaseRef xlink:type="simple" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="link_label.xml" xlink:role="http://www.xbrl.org/2003/role/labelLinkbaseRef" /> </appinfo> </annotation> <import namespace=http://www.xbrl.org/2003/instance schemaLocation="http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd" /> <element name="sample_name" id="sample_id" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" /> <element name="sample_name2" id="sample_id2" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant" /> </schema>
--- Linkbase document: link_presentaion.xml ---
<?xml version="1.0" ?> <linkbase xmlns="http://www.xbrl.org/2003/linkbase" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > <presentationLink xlink:type="extended" xlink:role="http://www.xbrl.org/2003/role/link"> <loc xlink:type="locator" xlink:href="sampleTaxonomy.xsd#sample_id" xlink:label="src" /> <loc xlink:type="locator" xlink:href="sampleTaxonomy.xsd#sample_id2" xlink:label="dest" /> <presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="src" xlink:to="dest" order="10.0" /> </presentationLink> </linkbase>
--- Linkbase document: link_label.xml ---
<?xml version="1.0" ?> <linkbase xmlns="http://www.xbrl.org/2003/linkbase" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <labelLink xlink:type="extended" xlink:role="http://www.xbrl.org/2003/role/link"> <loc xlink:type="locator" xlink:href="sampleTaxonomy.xsd#sample_id" xlink:label="element" /> <label xlink:type="resource" xlink:label="label" xml:lang="ja">Test</label> <labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="element" xlink:to="label" />
74
</labelLink> </linkbase>
--- Instance document: sampleInstance.xml ---
<?xml version="1.0" ?> <xbrl xmlns="http://www.xbrl.org/2003/instance" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fj="http://www.fujitsu.com/xbrl/sample" xmlns:ISO4217="http://www.xbrl.org/2003/iso4217" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <link:schemaRef xlink:type="simple" xlink:href="sampleTaxonomy.xsd" /> <context id="i1"> <entity> <identifier scheme="http://www.fujitsu.com/xbrl/sample">SAMPLE</identifier> </entity> <period> <instant>2001-12-14</instant> </period> </context> <unit id="u1"> <measure>ISO4217:JPY</measure> </unit> <fj:sample_name precision="18" contextRef="i1" unitRef="u1">100</fj:sample_name> </xbrl>
--- Serialization file: serialize.dat --- (This file is not provided here because it is a binary file.)
75
Appendix B Samples of Overridden Documents
--- Taxonomy: sample_base.xsd ---
<?xml version="1.0" encoding="UTF-8"?> <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:fjb="http://www.fujitsu.com/demo/2002-11-11" elementFormDefault="qualified" targetNamespace="http://www.fujitsu.com/demo/2002-11-11"> <annotation> <appinfo> <link:linkbaseRef xlink:type="simple" xlink:actuate="onRequest" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="link_base.xml" xlink:role="http://www.xbrl.org/2003/role/presentationLinkbaseRef"> presentationLink </link:linkbaseRef> </appinfo> </annotation> <import namespace=http://www.xbrl.org/2003/instance schemaLocation="http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd"/> <element id="testroot" name="testroot" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant"/> <element id="test1" name="test1" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant"/> <element id="test2" name="test2" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" xbrli:periodType="instant"/> </schema>
--- Taxonomy: sample_over.xsd ---
<?xml version="1.0" encoding="UTF-8"?> <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:fjo="http://www.fujitsu.com/demo/2002-11-12" elementFormDefault="qualified" targetNamespace="http://www.fujitsu.com/demo/2002-11-12"> <annotation> <appinfo> <link:linkbaseRef xlink:type="simple" xlink:actuate="onRequest" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="link_over.xml" xlink:role="http://www.xbrl.org/2003/role/presentationLinkbaseRef"> presentationLink </link:linkbaseRef> </appinfo> </annotation> <import namespace="http://www.fujitsu.com/demo/2002-11-11" schemaLocation="sample_base.xsd"/> </schema>
--- Link document: link_base.xml ---
<?xml version="1.0" encoding="UTF-8"?> <linkbase
76
xmlns="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink"> <presentationLink xlink:type="extended" xlink:role="http://www.xbrl.org/2003/role/link"> <loc xlink:type="locator" xlink:href="sample_base.xsd#testroot" xlink:label="src"/> <loc xlink:type="locator" xlink:href="sample_base.xsd#test1" xlink:label="dest"/> <presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="src" xlink:to="dest" xlink:actuate="onRequest" xlink:show="replace" priority="0" order="1.0"/> </presentationLink> <presentationLink xlink:type="extended" xlink:role="http://www.xbrl.org/2003/role/link"> <loc xlink:type="locator" xlink:href="sample_base.xsd#testroot" xlink:label="src"/> <loc xlink:type="locator" xlink:href="sample_base.xsd#test2" xlink:label="dest"/> <presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="src" xlink:to="dest" xlink:actuate="onRequest" xlink:show="replace" priority="0" order="1.0"/> </presentationLink> </linkbase>
--- Link document: link_over.xml ---
<?xml version="1.0" encoding="UTF-8"?> <linkbase xmlns="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink"> <presentationLink xlink:type="extended" xlink:role="http://www.xbrl.org/2003/role/link"> <loc xlink:type="locator" xlink:href="sample_base.xsd#testroot" xlink:label="src"/> <loc xlink:type="locator" xlink:href="sample_base.xsd#test2" xlink:label="dest"/> <presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="src" xlink:to="dest" xlink:actuate="onRequest" xlink:show="replace" priority="1" order="1" use="prohibited"/> </presentationLink> <presentationLink xlink:type="extended" xlink:role="http://www.xbrl.org/2003/role/link"> <loc xlink:type="locator" xlink:href="sample_base.xsd#testroot" xlink:label="src"/> <loc xlink:type="locator" xlink:href="sample_base.xsd#test2" xlink:label="dest"/> <presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="src" xlink:to="dest" xlink:actuate="onRequest" xlink:show="replace" priority="2" order="0.1"/> </presentationLink> </linkbase>
--- OverrideSample.cs ---
using System; using StreamSource = Fujitsu.XML.XBRL.Jaxp.Transform.Stream.StreamSource; using LinkList = Fujitsu.XML.XBRL.XWand.Common.LinkList;
77
using RelationLink = Fujitsu.XML.XBRL.XWand.Common.RelationLink; using RelationLink_Fields = Fujitsu.XML.XBRL.XWand.Common.RelationLink_Fields; using XBRLProcessor = Fujitsu.XML.XBRL.XWand.Processor.XBRLProcessor; using ElementDecl = Fujitsu.XML.XBRL.XWand.Taxonomy.ElementDecl; using PresentationLink = Fujitsu.XML.XBRL.XWand.Taxonomy.PresentationLink; using TaxonomySet = Fujitsu.XML.XBRL.XWand.Taxonomy.TaxonomySet; class OverrideSample { public static void Main() { XBRLProcessor xbrlProc = new XBRLProcessor(); //Document before overriding TaxonomySet taxonomySet = xbrlProc.loadTaxonomySet(new StreamSource("sample_base.xsd")); Console.Error.WriteLine("===== Before overriding ====="); test((PresentationLink)taxonomySet.RootPresentationLinks.get(0)); Console.Error.WriteLine(); //Document after overriding taxonomySet = xbrlProc.loadTaxonomySet(new StreamSource("sample_over.xsd")); Console.Error.WriteLine("===== After overriding ====="); test((PresentationLink)taxonomySet.RootPresentationLinks.get(0)); } public static void test(PresentationLink presentation) { LinkList children = presentation.getChildren(RelationLink_Fields.FILTER_ORDERING, null, null); for (int cIndex = 0; cIndex < children.size(); cIndex++) { PresentationLink pLink = (PresentationLink)children.get(cIndex); Console.Error.WriteLine(((ElementDecl)pLink.Anchor).Name); } } }
--- Console output ---
(Omitted) ===== Before overriding ===== test1 test2 (Omitted) ===== After overriding ===== test2 test1