XBRL Resources are the containers of information that may be associated with concept definitions in XBRL. The association is established using relationships. An XBRL Resource is an XML Element that is also an xlink resource.
According to the definition of the XBRL Infoset, a DTS (represented in the API as a DTSContainer object) has a collection of all resources defined in the DTS.
How to create an instance of an XBRLResource
The API offers a method that creates a new instance of an XBRL resource [XBRLResource(XBRLExtendedLink container, QName type, boolean addToParent)].
Calling this method requires three parameters:
- The container parameter is an instance of an extended link. It could be a LabelLink, a ReferenceLink, a FootnoteLink, a GenericLink or any custom extended link.
- The type parameter is the QName of the root element of the resource. The schema with the element definition must be previously loaded in the set of schemas available in the DTSContainer before the resource is created.
- The addToParent parameter is a boolean value. If true the extended link container element is informed about the existence of a new resource.
The creation of a resource automatically detects the resource type according to the type definition in the XML Schema.
According to the type definition of the resource element the resource can be of two possible types:
Simple type resources
Simple content type resource (like label resources), in this case the resource content does not contain nested XML elements
Complex type resources
Complex content type resources (like references), in this case the resource content contains nested XML elements.