xsd2er

This module is used to generate a Data Flow from a Source Schema (XSD).

Parameters

To get all the supported xsd2er parameters the following command can be used:

$ xsd2er --help

All the compatible paramters that can be used are listed:

Usage: xsd2er [Options] [INPUT...]

INPUT                           Files or directories input location path
                                

Options:

-h, --help

--version

# schema

-x, --schema-origin ID          Schema Origin ID
                                
--schema-name NAME              Schema name
                                
-j, --job ID                    Job ID
                                

# input data

-r, --root  ROOT,...            Process only requested root elements
                                
-R, --unref-root                Unreferenced elements will be considered roots
                                
-f, --file-root FILE,...        Process only requested root schema files
                                
-F, --unref-file-root           Unreferenced files will be considered root files
                                
-N, --with-target               Only files with target namespace will be considered
                                
-a, --use-stats ID,...          Use the stats to generate the new schema
                                
--archive-read                  Read archive files. zip, tar, jar, cpio, 7z...
                                default: true

--filter-content                Filter content, wrong bytes and charset detection
                                default: true

--detect-type                   Ignores non XSD files based on detected media type
                                default: true


# metadata

-m, --meta URL                  JDBC location of metadata store
                                default: jdbc:postgresql:x2er

-u, --meta-user USER            Metadata user
                                default: flex2er

-p, --meta-password PASSWORD    Metadata password

-B, --batchsize BATCHSIZE       Batch size to write into metadata
                                default: 1000

-g,--map MAPPING                Mapping generating and optimization levels:
                                  - "": Disabled
                                  - 0: No optimized mapping
                                  - 1: Elevate optimization (1=1)
                                  - 2: Reference optimization (type="", ref="")
                                  - 3: Elevate + Reference optimization

--name-max-len SIZE             Maximum column size for mapping generating
                                default: 128


# actions

-X, --xpath                     Print processed XPaths
                                
-z, --xpath-full                Print processed XPaths including attributes
                                
--xpath-phase                   Which phase the XPaths can be printed:
                                 - [u]nit => When it builds data_units
                                 - [d]ef => When it builds du_defs
                                 - [a]ll => In both phase
                                default: u

--levels LEVEL                  Recursive <TAG> levels treatment:
                                 - 0: Disabled, don't stop
                                 - <n>: Number of accepted recursions
                                default: 1

--levels-type LEVEL             Recursive <TAG> types levels treatment:
                                 - 0: Disabled, don't stop
                                 - <n>: Number of accepted recursions
                                default: 2

--stop-policy POLICY            The stopping policy applied in case of a recursion:
                                 - [u]nlimited: Unlimited, keep forward until the end or the recursive levels limit
                                 - [s]top or 0: Stop immediately
                                 - +: Keep forward only with one-to-one parent/child relationships
                                 - +<n>: Keep forward only with one-to-one parent/child relationships, up to N child levels
                                 - <n>: skip N child levels before stop.
                                 - <n>+: skip N child levels before keeping forward with one-to-one only
                                 - <n>+<n> skip N child levels before keeping forward with one-to-one only, up to N child levels
                                default: +

-c, --commands                  Show SQL commands
                                
-s, --skip                      Skip writing results

Examples:

- Common case:

  xsd2er pathTo/schema.xsd

- Print element xpaths and sql commands:

  xsd2er -Xc pathTo/schema.xsd

- Print the full xpaths (elements and attributes), sql commands and skip
  to executed them into the output location:

  xsd2er -zs pathTo/schema.xsd

- Process XSDs inside of directory, choose an unreferenced element to be the
  first and print the full xpaths:

  xsd2er -zR pathTo/dirWithXsds/

-  Process two related schemas and define a element named root as the first

  xsd2er -r root pathTo/schema1.xsd pathTo/schema2.xsd