Organisation for Economic Co-operation and Development - OECD
SMF-STF Bridge - Technical manual
Version 1.0
Status
working documentinternal version
subject to acceptance / X
approved
SMF-STF Bridge - Technical manual / OECD
Listeof modifications
Date / Author / Version / Nature20 March 2008 / E. Rillaerts / 0.1 / Created
16 May 2008 / E. Rillaerts / 0.2 / Global updated
16 July 2008 / E. Rillaerts / 0.3 / Added section 4.3. STF Validation
6 October 2008 / E. Rillaerts / 0.4 / Updated section 3
20 January 2011 / E. Tassenoy / 1.0 / Update to version 1.0
Reference List
OECD-SMF-Manual: TIES - Tax Information Exchange System Manual.
OECD: Manual on the implementation of exchange of information provisions for tax purposes.
The OECD Standard Transmission Format for international information exchange in taxation - An introduction
Document name / Date/Version / PageSMF-STF Bridge - Technical manual.doc / 12/9/2018/ 1.0 / 1/8
SMF-STF Bridge - Technical manual / OECD
Table Of Contents
1.Introduction
1.1.Subject of the document
1.2.Definitions and abbreviations
2.STF XML Schema
2.1.XML Schema (XSD)
3.XML Validation
3.1.Validation using XML parsers
3.2.Validation using standalone and web-based tools
4.OECD Bridge
4.1.Preparation phase
4.2.XSL Transformation
4.3.STF validation
Document name / Date/Version / PageSMF-STF Bridge - Technical manual.doc / 12/9/2018/ 1.0 / 1/8
SMF-STF Bridge - Technical manual / OECD
1.Introduction
1.1.Subject of the document
This document gives on overview of the different technical aspects related to the SMF-STF bridge.
1.2.Definitions and abbreviations
SMF:Standard Magnetic Format
STF : Standard Transmission Format for international information exchange in taxation.
2.STF XML Schema
The STF XML schema describes the structure of a STF XML document.
The schema representing the root element is defined in the xsd file stfdirect-2.1.xsd. This schema contains the STF_OECD element, the root element of an STF XML document. This element is in fact a complex type that contains a MessageSpecelement and one or more STF_DIRECT elements. The STF_DIRECTelement is a complex type that has several child elements of a specific type. Thedefinition of these different typescan be found in the xsd file stftypes-2.1.xsd. Other schema definitions can be found in isotypes_v2.1.xsd, oecdtypes_v1.xsd and specifictypes_v2.xsd.
More information on the STF schema can be found in the document STFexplained-1.0a.doc - The OECD Standard Transmission Format for international information exchange in taxation - An introduction and STFexpl-1.0-app3-tecdocu.doc- The different schema elements in detail.
Following chapter explains what an XML schema is.
2.1.XML Schema (XSD)
An XML Schema describes the structure of an XML document.The XML Schema language is also referred to as XML Schema Definition (XSD).An XML Schema instance typically has the filename extension ".xsd".
XML Schema is an XML-based representation of the structure of an XML document.
XSD provides the syntax and defines a way in which elements and attributes can be represented in a XML document. It also advocates that the given XML document should be of a specific format and specific data type.
The XML Schema data model includes:
- the vocabulary (element and attribute names)
- the content model (relationships and structure)
- the data types.
XSD is fully recommended by W3C consortium as a standard for defining an XML Document. To know more about latest information on XSD, please refer the W3C site (
3.XML Validation
A STF document should be well-formed and valid according to the STF XML schema.
A XML Schema consists of a set of rules to which an XML document must conform in order to be considered 'valid' according to that schema.
The process of checking to see if an XML document conforms to a schema is called validation, which is separate from XML's core concept of syntactic well-formedness. All XML documents must be well-formed, but it is not required that a document be valid unless the XML parser is "validating," in which case the document is also checked for conformance with its associated schema.
Documents are only considered valid if they satisfy the requirements of the schema with which they have been associated.
XML Schema validations can be effectively performed using specialized parsers like SAX, DOM and different open source and commercial standalone and web-based tools. The Bridge tool uses the SAX parser that is provided with the JAVA runtime.
3.1.Validation using XML parsers
Several XML parsers are able to validate the parsed XML against an XML schema. Examples are implementations of the SAX (Simple API for XML) and DOM (Document Object Model) parser API, like Xerces (available in Java and C++) and Saxon.
3.2.Validation using standalone and web-based tools
A few examples of tools providing XML validation.
XSV (XML Schema Validator) is an open source schema-aware processor. See
Commercial XML editors like XMLSpy, oXygen, ...
4.OECDBridge
The bridge transforms a SMF file into the STF XML format and vice versa. The bridging is performed via an XSL transformation.
There aretwo XSL transformationstylesheets and have the self-explanatory names
- smf2stf
- stf2smf
The XML file created in the preparation phase (see 4.1) will serve as input for the XSLT transformation of SMF to STF. Transforming STF into SMF does not require preparation, since STF documents are actually XML documents.
Chapter 5.2Transformation explains what an XSL transformation is.
For more information about the mapping of the content between the two different formats, please refer to the document “SMF-STF Bridge Transformation”.
4.1.Preparation phase
Bridging is done via an XSL Transformation. As such transformations operate on XML files, a preparatory task is to format the SMF file into an XML file. The transformation XSLT expects the input wrapped by a root element tag “SMFFile” and the individual records content stored into “Record” elements.
This conversion is done by a custom parser. This parser read each line (record) of a SMF file and stores it as a «Record» element in the output XML file.
Figure 1 - XML Schema of a SMF-XML file
4.2.XSL Transformation
Extensible Stylesheet Language Transformations (XSLT) is a language that lets youconvert XML documents into something else. That something else can beanother XML document, a HTML document, flat text file oralmost anything you like. When you specify a series of XSLT instructions forconverting a class of XML documents, you do so by creating a “stylesheet,” an XMLdocument that uses specialized XML elements and attributes that describe thechanges you want made. The definition of these specialized elements and attributescomes from the World Wide Web Consortium (W3C).
The version used in the Bridge Tool is XSLT 1.0.
4.3.STF validation
When a STF is transformed into a SMF file it is first validated against the STF XML schema.
The validation is performed by the default SAX parser and the XSL transformation by the XSLT engine provided by Java (J2SE).
In java version 1.5 and 1.6 the provided parser is Xerces and the transformer engine is Xalan XSLTC.
Java version 1.4 does not provide a XSD validating parser; this is the reason why java version 1.5 or higher is required to run this tool.
Document name / Date/Version / PageSMF-STF Bridge - Technical manual.doc / 12/9/2018/ 1.0 / 1/8