Welcome Guest!
Create Account | Login
Locator+ Code:

Search:
FTPOnline Channels Conferences Resources Hot Topics Partner Sites Magazines About FTP RSS 2.0 Feed

email article
printer friendly
get the code
more resources

Efficient XML Document Exchange
Reduce transfer and processing time through an open source .Net component that compresses large XML documents
by Dan Wahlin

February 2003 Issue

XML documents tend to be verbose because of their inherent descriptive nature. As a result, documents can become large as the data being described grows, and large documents can cause problems when they need to be exchanged with other entities. XML documents are especially verbose compared to other alternatives such as flat files or Electronic Data Interchange (EDI). To illustrate this concept, take a look at this flat file:

John,Doe,1587,4/18/2000,1234 
	Anywhere St.,SomeCity,AZ,85222

Then take a look at this XML document:

<customers>
	<customer customerID="1587">
		<firstName>John</firstName>
		<lastName>Doe</lastName>
		<customerSince>4/18/2000
		</customerSince>
		<street>1234 Anywhere St.
		</street>
		<city>SomeCity</city>
		<state>AZ</state>
		<postalCode>85222</postalCode>
	</customer>
</customers>
ADVERTISEMENT

If you've worked much with XML, then it shouldn't be any surprise that the XML document is much bigger than the comma-separated flat file, even though it contains the same raw data. After all, XML is a metadata language (which has numerous benefits such as support for parsing, validation, transformation, and so on), so it's a given that the size will be larger than some of the other competing document formats. As XML becomes even more popular as a means for exchanging data, it goes without saying that the size of the documents being exchanged can reduce an application's performance and scalability.

There are ways to minimize the size of an XML document, such as converting elements to attributes (where appropriate), abbreviating element and attribute names, and stripping out insignificant white space, to name just a few. No matter what changes you make, however, large amounts of raw data eventually will equate to large XML documents. If your XML documents grow to be many megabytes in size, how can you transfer them efficiently within your company or to other companies?

Back to top











Java Pro | Visual Studio Magazine | Windows Server System Magazine
.NET Magazine | Enterprise Architect | XML & Web Services Magazine
VSLive! | Thunder Lizard Events | Discussions | Newsletters | FTPOnline Home