|
|
|
To quickly create a new XML document you can use the XMLTextWriter class. There are many ways to create XML in the .NET Framework, but the XMLTextWriter is one of the quickest. |
Click here to copy the following block | Dim mywriter As System.Xml.XmlTextWriter
mywriter = New System.Xml.XmlTextWriter("c:\myxml.xml", Nothing)
With mywriter .Indentation = 4 .IndentChar = " " .Formatting = .Indentation
.WriteStartDocument() .WriteComment("This Is A List of My Books")
.WriteStartElement("MyBooks") .WriteStartElement("Book") .WriteAttributeString("ISBN", "1861005652") .WriteAttributeString("Title", "Professional Visual Basic Interoperability") .WriteElementString("Author", "Billy Hollis") .WriteElementString("Author", "Rockford Lhotka") .WriteEndElement() .WriteEndElement()
.WriteEndDocument() End With
mywriter.Flush() mywriter.Close() |
Click here to copy the following block | <?xml version="1.0" ?> <!-- This Is A List of My Books --> <MyBooks> <Book ISBN="1861005652" Title="Professional Visual Basic Interoperability"> <Author>Billy Hollis</Author> <Author>Rockford Lhotka</Author> </Book> </MyBooks> |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|