BASIC USAGE

To start DATA FORMATS ANALYZER open a terminal in the DATA--FORMATS--ANALYZER--1-1-1 directory. Then, you can run python Dfa.py to see a quick help that lists the arguments required by the INIT SERVICE of DATA FORMATS ANALYZER. All other commands accepted by DATA FORMATS ANALYZER have the following structure:

python Dfa.py 'VERBOSITY' 'MODE' './Schemas/SCHEMA--FORMAT--VERSION.xsd' 'OUTPUT VERSION' 'FORMAT' 'FORMAT VERSION' 'ROOT ELEMENT NAME'

Examples:

  • Extract data about the XDfile format (assuming the path to the XDfile schema is ./Schemas/SCHEMA--XDFILE--20110328.xsd):

    python Dfa.py 'WE' 'X' './Schemas/SCHEMA--XDFILE--20110328.xsd' 'V-1-0' 'XDFILE' '20110328' 'XDfile'
    

    Note that to compact the extracted information and descriptions data about attributes, elements or types you can use the XSLT stylesheet provided as a part of DATA FORMATS ANALYZER in the DfaCompactInfoAndDescriptions.xsl file.

  • Convert the XDfile data from XML to DSV and TEX (the conversion from DSV to XML would differ only in the 'CD' mode being used):

    python Dfa.py 'WE' 'CX' '' 'V-1-0' 'XDFILE' '20110328' ''
    

    Note that TEX files are intended for integrating the obtained data into a PDF output, while DSV files may help you edit the data more easily. For example you can import DSV files to your Google Drive in a form of Google Spreadsheets to enable collaborative editing or you may just utilize DSV files in your local spreadsheet application.

  • To preview the updated XDfile data you can update the XHTML and XML files extracted previously from the XDfile schema. First export the DSV files with edited XDfile data from your spreadsheet application. Then apply the conversion from DSV to XML (as described above) to obtain the converted XML files containing the updated XDfile data. Finally, update the XHTML file with reference and XML file with concepts data. Thus, in total two commands are needed:

    python Dfa.py 'WE' 'CD' '' 'V-1-1' 'XDFILE' '20110328' ''
    python Dfa.py 'WE' 'P' '.' 'V-1-1' 'XDFILE' '20110328' ''
    

    Note that the XML file with concepts data is updated or created from scratch if needed. To compact or sort the concepts data you can use the XSLT stylesheets provided as a part of DATA FORMATS ANALYZER in the DfaCompactConcepts.xsl and DfaSortConcepts.xsl files.

Required Software Dependencies

In order to run the commands listed above you will need a Python environment with these installed modules: csv, datetime, lxml.etree, os, re, sys, xml.dom.minidom and xml.sax.saxutils (only the lxml.etree module is not included in the Python Standard Library and needs to be installed separately). The XSLT stylesheets provided as a part of DATA FORMATS ANALYZER can be used with any standard XSLT 2.0 processor such as Saxon.

All commands were tested on Debian Linux 8 and should work on similar Unix-based operating systems. On Windows and other operating systems commands should work after necessary syntax changes provided all required software is correctly installed.

Abbreviations

  • DSV - Delimiter Separated Values
  • HTML - HyperText Markup Language
  • TEX - TeX (typesetting system)
  • XHTML - Extensible HyperText Markup Language
  • XML - Extensible Markup Language
  • XSD - World Wide Web Consortium XML Schema Definition Language
  • XSLT - Extensible Stylesheet Language Transformations

Table Of Contents

Previous topic

DATA FORMATS ANALYZER DOCUMENTATION

Next topic

INIT SERVICE