How do I create an XML file for my VB 2005 App?

D

dm1608

I would like to plug in a bunch of static, but related, information into a
XML file that can be used by my VB.NET 2005 utility application.

I would like to do something like:

<shortname>
<longname>
<description>
<version>
<dateupdated>
</shortname>
<shortname>
<longname>
<description>
<version>
<dateupdated>
</shortname>
<shortname>
<longname>
<description>
<version>
<dateupdated>
</shortname>
<shortname>
<longname>
<description>
<version>
<dateupdated>
</shortname>
....
....

How do I initially create this sort of XML file for my app? Can I use
VS.NET 2005 IDE or must I do it by hand or use a third party XML editor
tool?

How do I read it?

I see a lot about how to work with consuming an XML file, but never see
anything about creating on for your own application and consuming it.

Any help or direction would be appreciated.
 
P

Peter Flynn

dm1608 said:
I would like to plug in a bunch of static, but related, information
into a XML file that can be used by my VB.NET 2005 utility
application. [snip]
How do I initially create this sort of XML file for my app? Can I use
VS.NET 2005 IDE or must I do it by hand or use a third party XML
editor tool?

XML is just plain text, so for a single-occurrence file, just create
it using any plain-text editor. If you want to ensure it is created
accurately and consistently, however, use a proper XML editor. If it
really is a 1-off task, using an IDE is probably overkill unless there
is some programmatically-accessible data that needs including that you
can't get at by hand-editing.
How do I read it?

Open it in a plain-text editor if you mean "how do I, as a human, read
it". Otherwise it depends what you want to do with it afterwards: it's
a file, so you open it in some kind of application.
I see a lot about how to work with consuming an XML file, but never
see anything about creating on for your own application and consuming
it.

This is worrying. A plain-text file is not hard to create. As someone
who writes a lot of documentation, I would value your input (off-group)
as to what we tech authors are not explaining that need explaining.
We've clearly missed something important here. And I'd appreciate more
input from others in the same position (but not here: use email).

///Peter
 
G

Guest

You can choose Add/ New Item from the Project context menu, and choose "Xml
File". This will create a new blank Xml File in the IDE that you can edit.
Peter
 
P

Paul Wu

Once you have the xml file created and is stored in a known location, it is
extremely easy to read an XML file using the XmlDocument class.

Try this:

Dim XmlDoc As New System.Xml.XmlDocument

XmlDoc.Load("filename.xml")



Paul Wu

www.rulemasters.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top