-------------------------------------------------------------------------
Efficient XML Interchange (EXI) Processor
Version Date: 22 Mar 2012
Author: Craig Garrett, garrett at mitre.org
Copyright (C) 2012 The MITRE Corporation
Approved for Public Release: 11-4339. Distribution Unlimited
This program and its interfaces are free software;
you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-------------------------------------------------------------------------
Description: This command-line tool can be used to encode text XML to
binary EXI, and decode EXI to text XML. It is meant to facilitate
learning about the various EXI encoding and decoding options.
This program was written in Java and uses the open source EXI
library 'EXIficient' developed by Daniel Peintner of Siemens AG:
http://exificient.sourceforge.net/
For more information on EXI, please see the W3C Specification:
http://www.w3.org/TR/2011/REC-exi-20110310/#options
-------------------------------------------------------------------------
Command Line Examples:
To use the executable Jar file: java -jar ExiProcessor.jar [command-line args]
To use the compiled .class files: java -cp .\bin;.\lib\exificient.jar;.\lib\xercesImpl.jar;.\lib\xml-apis.jar ExiProcessor [command-line args]
Encode XML to EXI:
java -jar ExiProcessor.jar -xml_in .\sample-data\notebook.xml -exi_out .\sample-out\notebook.exi
Decode EXI to XML file:
java -jar ExiProcessor.jar -exi_in .\sample-out\notebook.exi -xml_out .\sample-out\notebook.decoded.xml
Decode EXI to XML on stdout:
java -jar ExiProcessor.jar -exi_in .\sample-out\notebook.exi
-------------------------------------------------------------------------
Command Line Help:
\>java -jar ExiProcessor.jar
Efficient XML Interchange (EXI) Processor
This program can be used to encode text XML to binary EXI, and decode EXI to text XML.
Encode XML to EXI:
java -jar ExiProcessor.jar -xml_in sample.xml -exi_out sample.exi
Decode EXI to XML:
java -jar ExiProcessor.jar -exi_in sample.exi -xml_out sample.xml
Decode EXI to stdout:
java -jar ExiProcessor.jar -exi_in sample.exi
Command Line Options:
-xml_in [XML source file]
Read text XML data from this file
Example: -xml_in sampleInput.xml
-exi_out [EXI destination file]
Writes EXI encoded data to this file
Example: -exi_out sampleOutput.exi
-exi_in [EXI source file]
Read text EXI data from this file
Example: -exi_in sampleInput.exi
-xml_out [XML destination file]
Writes text XML data to this file
Example: -xml_out sampleOutput.xml
-cookie
Includes the EXI Cookie in the Header (the string '$EXI' will be the first 4 bytes of the file); default is off. This option is not needed during decoding.
URL: http://www.w3.org/TR/exi/#header
-header_options
Includes flags in the Header indicating which EXI Options were used during encoding; default is off. This option is not needed during decoding.
URL: http://www.w3.org/TR/exi/#header
-schema [XML Schema file]
Uses the specified XML Schema (XML Schema 1.0 only) for encoding and decoding to increase compression; default is schema-less encoding and decoding. During decoding, this option will override any 'schemaId' value in the EXI Header, but if this option does not resolve to a valid path/filename, then the program will attempt to load a schema using the 'schemaId' header value as a path/filename.
URL: http://www.w3.org/TR/exi/#informedGrammars
Example: -schema mySchema.xsd
-strict
Increase compactness by allowing only grammars defined by the XML Schema (use only in schema-informed mode); default is off. Not compatible with preserve_prefixes, preserve_dtd, preserve_comments, and preserve_pi.
URL: http://www.w3.org/TR/exi/#key-strictOption
-xsd_types_only
Only use XML Schema Datatypes (types defined by the W3C XML Schema specification) when instance docs make use of xsi:type; default is off. Should not be used with -strict.
URL: http://www.w3.org/TR/exi/#builtinElemGrammars
-compression
Increases compactness using additional computational resources; default is off. Overrides all 'alignment' option values. Provides best results when message sizes large and repetitive.
URL: http://www.w3.org/TR/exi/#compression
-alignment [bit_packed, byte_packed, pre_compression]
Controls the alignment of event codes and content items. Incompatible with the compression option. Default is bit_packed.
URL: http://www.w3.org/TR/exi/#key-alignmentOption
Example: -alignment pre_compression
-preserve_prefixes
Enables preservation of XML namespace prefixes when encoding to EXI; default is off. Enabling this option will disable -strict.
URL: http://www.w3.org/TR/exi/#fidelityOptions
-preserve_dtd
Enables preservation of embedded DTD in XML documents when encoding to EXI; default is off. Enabling this option will disable -strict.
URL: http://www.w3.org/TR/exi/#fidelityOptions
-preserve_lexicalValues
Enables preservation of the Lexical form of element and attribute values when encoding to EXI; default is off.
URL: http://www.w3.org/TR/exi/#fidelityOptions
-preserve_comments
Enables preservation of XML Comments when encoding to EXI; default is off. Enabling this option will disable -strict.
URL: http://www.w3.org/TR/exi/#fidelityOptions
-preserve_pi
Enables preservation of Processing Instructions when encoding to EXI; default is off. Enabling this option will disable -strict.
URL: http://www.w3.org/TR/exi/#fidelityOptions
-xsi_schemaLocation
Includes/preserves xsi:schemaLocation/noNamespaceSchemaLocation attribute; default is off. This option is not needed during decoding.
URL: http://www.w3.org/TR/exi/#addingProductionsStrict
-schemaID [XML Schema ID]
Includes the schemaId in the Header; default is off. The schemaId may be any string value according to the EXI specification, but during EXI decoding, this program will interpret the schemaId as a schema path/filename. Enabling this option will also enable -header_options. This option is only available if schema-informed coding is used (i.e. if -schema [XML Schema file] is provided). Because the schemaId value comes from the EXI file's header, this command-line option is not used during decoding (if present, it is ignored); instead, the schemaId value contained in the EXI Header will be used. Also see the -schema option for more information.
URL: http://www.w3.org/TR/exi/#key-schemaIdOption
Example: -schemaID mySchemaId
-self_contained
Enables the use of self-contained elements in the EXI stream; default is off.
URL: http://www.w3.org/TR/exi/#key-selfContained
-fragment
Indicates whether the EXI body is an EXI document or an EXI fragment; default is false.
URL: http://www.w3.org/TR/exi/#key-fragmentOption
-blockSize [bytes]
Specifies the block size (in bytes) used for EXI compression; default is 1,000,000 bytes.
URL: http://www.w3.org/TR/exi/#key-blockSizeOption
Example: -blockSize 65536
-valueMaxLength [bytes]
Specifies the maximum length of value content items to be considered for addition to the string table; default is 'unbounded'.
URL: http://www.w3.org/TR/exi/#key-valueMaxLengthOption
Example: -valueMaxLength 1024
-valuePartitionCapacity [bytes]
Specifies the maximum number of value content items in the string table at any given time; default is 'unbounded' when the 'valuePartitionCapacity' option is absent.
URL: http://www.w3.org/TR/exi/#key-valuePartitionCapacityOption
Example: -valuePartitionCapacity 1024
\>