|
Home > Products > DataDirect XML Converters > Data Conversion API Data Conversion API'sHaving a data conversion toolkit is a pretty handy item in your toolbox. It's too bad most of them cost more than your house, and are harder to run than a nuclear power plant. All that's about to change. The World's Simplest XML ConverterTo show how simple it is to use DataDirect XML Converters™, consider this program that reads EDI from one file specified on the command line, and writes it as XML to the other.
1import com.exln.stylus.io.*;
// From EDI to XML
11 System.out.println(args[0] + " --> " + args[1]);That's it! Of the eleven lines of code, only six are actually executable code, and of those, the call to the converter is only two lines long (see lines 9 and 10 above). And the Stylus Studio® EDI converter isn't some wimpy little converter either. It automatically can determine the type of EDI — whether it's EDIFACT, X12, IATA, EANCOM or HL7 — and can handle dozens of versions. It will produce wonderfully indented and documented XML. Many of the converters have additional options that can be set on the URL to tune their behavior — to set things such as encoding or delimiters or element names. Those same parameters can be added right to the URL string here. The easiest way to get them (even easier than reading the manual!) is to do File|Open in Stylus Studio® and to set them there, and then copy out the URL and paste it into your application. Ambidextrous ConvertersThe converter is bidirectional too, so that XML can be turned into EDI. To go into the other direction, the changes are just what you'd expect. They've been underlined below for clarity.
// From XML to EDICustom ConvertersIf you've build your own converter using Convert to XML, you can use that just as easily. Instead of putting in one of the built-in converter names, you specify the URL of the .conv converter definition file that you created, like this:
// Convert to XMLWe tried to make it more complicated, but we failed. Our loss is your gain! File Format ConvertersThe other converters, such as those for flat files or dBase files, or those created through the Convert to XML module, are run in exactly the same way. There is a growing series of converters available for your use. These include: Base-64 XML ConverterThis converts any file, text or binary (such as an image), into a XML document with a single element containing the Base-64 encoded content of the input file. This converter is most useful to embed some arbitrary binary data inside of another document, where the target document contains a field with the W3C XML Schema type of base64Binary. The following example in-lines the binary image for each shirt into an aggregate XML file.
<?xml version="1.0"?>For more detailed and bi-directional examples, along with explanations of the techniques involved, see the Binary XML How-to page. Binary XML ConverterThe binary converter is most useful for doing something similar to the Base-64 converter, except with hexadecimal output, as in the W3C XML Schema base64Hex datatype. It does have some other options, which allow output in other bases, such as decimal or octal or even binary. To see how this can be used to embed binary data into XML, see the Binary XML Tutorial page. Convert to XML ConverterWhen plain ol' comma-separated-values aren't enough, this is the sleek yet sophisticated Convert to XML converter. Unlike many other flat file converters, this provides a handsome user interface experience. Comma-Separated Value XML ConverterMore than just the plain-vanilla CSV converter, this supports multiple encodings and options to tweak the quote and escape characters. Despite its name, it shares a common heritage with the tab-separated-value converter, and supports other delimiters besides commas. dBase II, III, III+, IV and V XML ConvertersThe dBase file format has been around for a long time. It's surprising how many modern systems still store information in this format. Now you can get out what's been stuck inside — and now you can create these files as well. Data Interchange Format XML ConverterA useful spreadsheet interchange format, this goes all the way back to the days of VisiCalc. OpenEdge .d Data Dump XML ConverterOpenEdge has an extremely efficient and powerful database, and this converter allows you to read and write its text dump file format. Electronic Data Interchange XML ConverterThe most sophisticated and powerful converter in the library is the EDI converter. It automatically detects and parses EDIFACT, X12, IATA and EANCOM, and can handle reading or writing with equal facility. Also included are EDI XML Schema generators, which let you pick a vocabulary, a message type and a version and will generate an XML Schema that corresponds to the EDI message.
This converter generates beautiful XML, with options to indent and comment each element and code list lookup value — making reading the interchange data a treat and not a chore. HTML-to-XHTML HtmlTidyHTML Tidy is a widely-used tool that converts sloppy HTML into clean XHTML. And since XHTML is just a specific vocabulary of XML, this means you can use XQuery and XSLT to parse and transform even malformed pages found in the wild. Java .properties File XML ConverterJava .properties files are used for all sorts of tasks — from program configuration to internationalization/translation to raw data storage. Being able to read and subsequently write this format is a useful tool. JSON XML ConverterIt's become very convenient with all of this AJAX stuff going on, to communicate between web services using JavaScript Object Notation. This converter uses the algorithms on the JSON.org website to read from XML and write to JSON, and vice-versa, so that tools expecting XML can easily cross-communicate. This can be especially useful for calling services that expect JSON. Plain Text XML ConverterFor the most basic needs, this converter just reads in text one line at a time and wraps an element around each line, escaping any embedded & or > or < symbols. For when you just need your XSLT or XQuery to inhale raw text. E-mail XML ConverterWouldn't it be great if your program could read its own mail?
This converter contains the ability to parse the standard Pyx XML ConverterPyx is a line-orientated notation roughly equivalent to XML for expressing tree-oriented data. This converter will read and write the Pyx format. Rich Text Format XML ConverterThe RTF file format converter turns RTF into a straight XML representation of the RTF. Since it also works the other way, this provides a way to create RTF documents from XSLT or XQuery. Super Data Interchange Format XML ConverterThis format, also used by spreadsheets, builds on the base of the DIF converter. Symbolic Link Format XML ConverterPioneered by Microsoft MultiPlan, this format is used also for the exchange of spreadsheet data. Tab-Separated Value XML ConverterA format favored by Microsoft Excel, this and the comma-separated-value converter are two general-purpose tools no converter toolkit should be without. Windows .ini File XML ConverterSometimes it's useful to be able to read configuration data, or to update that data. This bidirectional converter lets you do just that. WinWrite XML ConverterIf you've got old text or instructions written with the default editor that came with older copies of Microsoft Windows, this one-way converter will get at that text for you. It turns it into XHTML, convenient for further processing or just right for leaving as-is. All Your Data Are Belong To UsThis is just quick overview of the power of DataDirect XML Converters™. New features are constantly being added — download a free trial and see how the conversion API can make short work of tough integration problems.
Content ManagementBuild Content Management systems with Stylus Studio's powerful XML publishing tools that enable you to unlock and re-use valuable content from your enterprise information repositories. Using the Stylus Studio XML Grid ViewThis free onlince video tutorial shows how to use the Stylus Studio XML Grid View. Working with Tables in XSLTThis free video tutorial about working with XSL tables covers how to handle iteration and looping using xsl:for-each to create HTML reports driven by XML data. XML-DEV BlogJoin the XML Development discussion at XML-Dev - the hottest place to talk about XML technologies, trends, systems architecture and all the latest buzz. Bookmark this RSS and ATOM feed now! Stylus Most Wanted |
PURCHASE STYLUS STUDIO ONLINE TODAY!!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Try Our Data Conversion API's TodayUsing DataDirect XML Converters — Powerful Data Conversion API's, you can run any data conversion from inside of your Java or .NET program code, instead of just doing them manually from within a desktop application — Download a free trial today! Attend a Live Webinar This Week!Learn about Stylus Studio's unique features and benefits in just under an hour. Register for the Stylus Studio QuickStart Training WebCast! Ask Someone You KnowDoes your company use Stylus Studio? Do your competitors? Engineers from over 100,000 leading companies use Stylus Studio, and now you can ask someone from your own organization about their experiences using Stylus Studio. Top Ten XQuery TrendsRead about the top 10 XQuery Trends and how they will impact change the way enterprise software applications are built. |

