Jim Bob wrote:
I need to use a file that is in xml format in vb.net.
I'm new here. I have MSSql 2000 and vb.net 2003. I have accessed SQL
files before. What is best.
1. Access the XML file directly?
There are multiple ways. If it is a small file and you don't need
highest performance but understandable code, use System.Xml.XmlDocument
wich provides an XML DOM wich means that the whole XML document will be
converted into a tree of objects (thus it won't work with large
documents and will be slow and oversized if you don't use all the data).
Then there is System.Xml.XPath.XPathDocument wich is a bit "lighter"
than XmlDocument and allows you to do queries using XPath, for example
from XSLT.
The fastest way, wich is also suitable for very large documents is the
use of System.Xml.Xml(Text)Reader/Writer. The reader is just a simple
parser wich allows you to navigate from one node to the next and
determine its type, name, namespace and value. The writer directly
writes XML tokens, it helps you with namespaces, indentation and has a
few comfort-methods for writing special content. It is also easy to
"stream-process" (large) XML files with those two classes.
--
Pascal Schmitt