O'Reilly logo

Visual Basic 2008 Recipes: A Problem-Solution Approach by Rakesh Rajan, Matthew MacDonald, Allen Jones, Todd Herman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.10. Convert an XML File to a Delimited File (and Vice Versa)

Problem

You need to convert the contents of an XML file to a text file with delimited fields or convert a text file with delimited fields to an XML file.

Solution

To transform XML data to a delimited text file, use a LINQ query to retrieve and data and project it into an appropriate format. To transform the delimited text file to an XML tree, read and parse the data while creating the necessary XML nodes using XML literals and embedded expressions.

How It Works

LINQ to XML gives you the power to quickly and easily transform XML data to and from different formats by altering or transforming XML nodes within a LINQ query. If you need to transform the data in an existing XML tree into ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required