Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
SDXF
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
'''SDXF''' ('''Structured Data eXchange Format''') is a [[data serialization]] format defined by RFC 3072.<ref>{{cite web|url=https://www.rfc-editor.org/rfc/rfc3072.html|title=RFC-3072|date=March 2001 |last1=Wildgrube |first1=Max }}</ref> It allows arbitrary structured data of different types to be assembled in one file for [[data exchange|exchanging]] between arbitrary computers. The ability to arbitrarily serialize data into a self-describing format is reminiscent of [[XML]], but SDXF is not a text format (as XML) β SDXF is not compatible with text editors. The maximal length of a datum (composite as well as elementary) encoded using SDXF is 16777215 bytes (one less than 16 [[megabyte|MB]]). ==Technical structure format== SDXF data can express arbitrary levels of structural depth. Data elements are [[self-documenting]], meaning that the [[metadata]] (numeric, character string or structure) are encoded into the data elements. The design of this format is simple and transparent: computer programs access SDXF data with the help of well-defined functions, exempting programmers from learning the precise data layout. The word "exchange" in the name reflects another kind of transparency: the SDXF functions provide a computer architecture independent conversion of the data. Serializations can be exchanged among computers (via direct network, file transfer or CD) without further measures. The SDXF functions on the receiving side handle architectural adaptation. [[Structured data]] is data with patterns predictable more complex than strings of text.<ref>It may be argued that "structured" is used here in the same sense as in [[structured programming]] β like there are no [[goto]]s in a (strictly) structured program, there are no [[pointer (computer programming)|pointer]]s/[[Reference (computer science)|references]] in SDXF. This need not be how the name arose, however.</ref> ==Example== A commercial example: two companies want to exchange digital invoices. The invoices have the following hierarchical nested structure: INVOICE β ββ INVOICE_NO ββ DATE ββ ADDRESS_SENDER β ββ NAME β ββ NAME β ββ STREET β ββ ZIP β ββ CITY β ββ COUNTRY ββ ADDRESS_RECIPIENT β ββ NAME β ββ NAME β ββ STREET β ββ ZIP β ββ CITY β ββ COUNTRY ββ INVOICE_SUM ββ SINGLE_ITEMS β ββ SINGLE_ITEM β β ββ QUANTITY β β ββ ITEM_NUMBER β β ββ ITEM_TEXT β β ββ CHARGE β β ββ SUM β ββ ... ββ CONDITIONS ... [[File:UML invoice.svg]] [[File:Example invoice relation structure.svg]] ==Structure== The basic element is a chunk. An SDXF serialization is itself a chunk. A chunk can consist of a set of smaller chunks. Chunks are composed of a header prefix of six bytes, followed by data. The header contains a chunk identifier as a 2-byte binary number (Chunk_ID), the chunk length and type. It may contain additional information about compression, encryption and more. The chunk type indicates whether the data consists of text (a string of characters), a binary number (integer or floating point) or if the chunk a composite of other chunks. Structured chunks enable the programmer to pack hierarchical constructions such as the INVOICE above into an SDXF structure as follow: Every named term (INVOICE, INVOICE_NO, DATE, ADDRESS_SENDER, etc.) is given a unique number out in the range 1 to 65535 (2 byte unsigned binary integer without sign). The top/outermost chunk is constructed with the ID INVOICE (that means with the associated numerical chunk_ID) as a structured chunk on level 1. This INVOICE chunk is filled with other chunks on level 2 and beyond: INVOICE_NO, DATE, ADDRESS_SENDER, ADDRESS_RECIPIENT, INVOICE_SUM, SINGLE_ITEMS, CONDITIONS. Some level 2 chunks are structured in turn as for the two addresses and SINGLE_ITEMS. For a precise description see page 2 of the RFC or alternatively here.<ref>{{cite web|url=http://pinpi.com/en/SDXF_2.htm |title=SDXF - 2. Description of the SDXF Format |publisher=Pinpi.com |date= |accessdate=2013-09-10}}</ref> SDXF allows programmer to work on SDXF structures with a compact function set. There are only few of them: <blockquote> {{col-float |1= ''To read Chunks, following functions has to be used:'' ; init : To initialize the parameter structure and linking to the existing Chunk. ; enter : To step into a structured Chunk, the 1st Chunk of this structure is ready to process. ; leave : To leave the current structure. This structure is already current. ; next : Goes to next Chunk if exists (otherwise it leaves the current structure). ; extract : To transfer (and adapt) data from the current Chunk into a program variable. ; select : To search the next Chunk with a given Chunk ID and make it current. |2= ''To build Chunks, following functions has to be used:'' ; init : To initialize the parameter structure and linking to an empty output buffer for to create a new Chunk. ; create : Create a new Chunk and append it to the current existing structure (if exists). ; append : Append a complete Chunk to an SDXF-Structure. ; leave : To leave the current structure. This structure is already current. }} </blockquote> The following [[pseudocode]] creates invoices: <syntaxhighlight lang="c"> init (sdx, buffersize=1000); // initialize the SDXF parameter structure sdx create (sdx, ID=INVOICE, datatype=STRUCTURED); // start of the main structure create (sdx, ID=INVOICE_NO, datatype=NUMERIC, value=123456); // create an elementary Chunk create (sdx, ID=DATE, datatype=CHAR, value="2005-06-17"); // once more create (sdx, ID=ADDRESS_SENDER, datatype=STRUCTURED); // Substructure create (sdx, ID=NAME, datatype=CHAR, value="Peter Somebody"); // element. Chunk inside this substructure ... create (sdx, ID= COUNTRY, datatype=CHAR, value="France"); // the last one inside this substructure leave; // closing the substructure ADDRESS_SENDER ... leave; // closing the substructure INVOICE </syntaxhighlight><ref>{{cite web|url=http://pinpi.com/en/PIN_63.htm |title=6.3 The Project PRNT: a complete example |publisher=PINPI |date= |accessdate=2013-09-10}}</ref> Pseudocode to extract the INVOICE structure could look like: <syntaxhighlight lang="c"> init (sdx, container=pointer to an SDXF-structure); // initialize the SDXF parameter structure sdx enter (sdx); // join into the INVOICE structure. // while (sdx.rc == SDX_RC_ok) { switch (sdx. Chunk_ID) { case INVOICE_NO: extract (sdx); invno = sdx.value; // the extract function put integer values into the parameter field 'value' break; // case DATE: extract (sdx); strcpy (invdate, sdx.data); // sdx.data is a pointer to the extracted character string break; // case ADDRESS_SENDER: enter (sdx); // we use 'enter' because ADDRESS is a structured Chunk do while (sdx.rc == SDX_RC_ok) // inner loop ... break; ... } } </syntaxhighlight> SDXF is not designed for readability or to be modified by text editors. A related editable structure is SDEF - Structured Data Editable Format.<ref>{{cite web|url=http://www.pinpi.com/en/sdef.htm |archive-url=https://web.archive.org/web/20160307070425/http://www.pinpi.com/en/sdef.htm |archive-date=2016-03-07 |title=SDEF Site (from Archive.org)}}</ref> ==See also== * [[External Data Representation]] * [[Protocol Buffers]] * [[Abstract Syntax Notation One]] * [[Apache Thrift]] * [[Etch (protocol)]] * [[Internet Communications Engine]] * [[Comparison of data serialization formats]] ==References== <references/> ==External links== * [http://www.pinpi.com/SDXF.htm Introduction chapter of a more detailed description] [[Category:Internet Standards]] [[Category:Internet protocols]] [[Category:Computer file formats]] [[Category:Data serialization formats]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite web
(
edit
)
Template:Col-float
(
edit
)