Flat File to XML Conversion Using Java or .NET: Custom XML Converters

DataDirect XML Converters™ provide built-in support for many common flat file formats. Additionally, using a powerful extensibility mechanism (Custom XML Converters), you can build your own converters designed for your specific file conversion needs.

Flat File Formats

Overall, DataDirect XML Converters™ can provide support a for wide variety of different flat file formats which can be processed by either built-in XML converters or user-defined, custom XML converters, including the following:

  • Flat Files, such as comma- and tab-separated value files.
  • Fixed-width Files, like dumps from databases or certain EDI-like formats.
  • Tagged Files, which contain multiple row types within a single data stream.
  • Hybrid Files — those that contain mixtures of the above qualities.

Specifically, the following file types are supported out-of-the-box:

  • Base-64
  • Binary
  • CSV
  • DIF
  • dBase
    (II, III, III+, IV, V)
  • HTML
  • JavaProps
  • JSON
  • DotD
  • Pyx
  • RTF
  • SDI
  • SYLK
  • Tab-separated values
  • Whole-line text
  • Windows .ini file
  • Windows Write

Additionally, Using Stylus Studio® 2008 XML Enterprise Suite, you can create custom XML conversions for extensions to standard file formats or even proprietary file formats. These custom XML conversions can then be consumed by DataDirect XML Converters™.

Data Types

The Custom XML Converters for Flat Files understand more than just textual data types. Often a file will contain binary information in any number of specialized formats — from hardware-specific types like BCD or IEEE Floats and Doubles to cross-platform standards such as COBOL Comp3 or ISO 8601 Date Time. Rather than having to resort to extension functions, using the DataDirect XML Converters™ Custom XML Converter allows you to specify the exact native data type and it will handle the conversion for you.

Supported datatypes include:

BCD (Binary Coded Decimal) Float
Binary (including the W3C Schema types base64Binary and hexBinary)
Boolean (including support for null or unknown values) Integer (32-bit integers)
Byte (8-bit integers) Long (64-bit integers)
Comp3 (the COBOL internal format; "IBM Packed") Number (unlimited-precision numbers)
Date (in multiple languages) Short (16-bit integers)
DateTime String
Decimal (from System.Decimal on .Net) Time
Double Zoned ("IBM Zoned" mainframe datatype)

Pattern Matching in Flat Files

Sophisticated pattern-matching technology lets you decode different rows within the same file using different record layouts. Perhaps you have master-detail records, or a header-body-trailer layout. Or perhaps the file contains many types, similar to the way EDI files are designed. Using the pattern-matching technology, specific markers within rows can be used to select which conversion rules should apply to which rows.

Flat File Converstion Performance

The Custom XML Converter has been designed for streaming environments. This means that it never has to hold the entire file in memory. It only needs to process a single row of data at a time. This keeps the memory requirements low.

Since the internals are designed for a streaming world, it only makes sense to expose those interfaces to the outside world. On the Java platform, the StAX platform is supported for a 'pull' API, and on .net the XmlReader interface is supported. Both platforms use string interning, a technique where costly string comparisons are replaced by machine-speed integer comparisons. (In fact, these are features of all of the converts designed by DataDirect Technologies.) In Java, the SAX interface is also supported for 'push' processing.

Simplify Flat File Conversion to XML

See for yourself why DataDirect XML Converters are the ultimate Flat File to XML Conversion Tool. Download a free trial or visit our online shop to buy now.

Contact An Account Representative Today

Do you ever just want to speak with someone in person to get all of your questions answered? Well our account reps are here to help. If you have any questions about purchasing or licensing, then give us a call at: 1 (800) 477-6473 x4488 or (781) 280-4488. Or you can simply request more information online.