intelliproject logo

Location: Desktop development - Visual Basic . NET    License: The Intelliproject Open License (IPOL)

Create an XML file with VB.NET

Posted by Manu Abraham

Describe how to create an XML file with VB.NET

Skill: Beginner

Posted: 02/12/2008

Views: 1618

Rating: 0.00 /5

Popularity: 0.00

Sign Up to vote for this article

Create an XML File with VB.NET

To create an XML file using VB.NET, we need to use the XmlWriter or XmlTextWriter classes.

The XmlTextWriter class is derived from XmlWriter class, which represents a writer that provides fast non-cached forward-only way of generating XML documents based on the W3C Extensible Markup Language (XML) 1.0 specification.

In this article, I will show you how to use XmlWriter class to create an XML document and write data to the document.

The XmlWriter class belongs to the 'System.xml' Namespace.So we need to import the particular namespace using the following line in our script.

Imports System.xml    

The create method allows you to specify the features to support on the created XmlWriter using XmlWriterSettings. This settings class has options for indentation, new lines, encoding and XML conformance level.

The above code will create the xml file named 'xmlfile.xml' on drive "C" and will looks like the following:

Please forward your queries and suggestions to:

manu@phppals.net

manu@manuabraham.info

http://manuabraham.info

 

License

This article, along with any associated source code and files, is licensed under The Intelliproject Open License (IPOL)

About the author

Manu Abraham

Manu Abraham having an experience of more than 3 years in PHP-MySQL web development.

Location: India
Ocupation: web Developer
Home page: http://manuabraham.info

Sign up to post message on the article message board!