First, the reader guides the reader to help you master the text of this article. Solve you to see that this article is not suitable for you, give you visual pollution. If you are writing some programs with ASP XML, or you are learning XML, it is worth seeing. Read the knowledge required by this article, there is a basic understanding of the ASP, which is basically understanding the XML and DOM. If you don't know, then you can basically grasp the application of ASP XML and DOM through this article, and can write from this article More advanced ASP XML programs. Second, the basic idea is based on the use of ASP and DOM to read and store XML data, and utilize XML data to store message information, and achieve the functionality of the same-use database storage data. Third, the advantage of the XML message may be asking you to ask the ASP TXT text can also achieve the function of not having the database, it is really possible, and there are many such a message on the Internet, but here I want to talk about ASP XML. Superiority. 1, XML ASP is fast than ASP TXT speed. Maybe you also found that when the txt file is very fast, the speed of the message information is large, but the speed is surprisingly slow. This is the weakness of the ASP TXT. Of course, I can't say that ASP XML must be surprising, but it is much better than ASP TXT, of course, as the message information increases the increase of XML text, it is very fast, but it is still better than TXT. Many (this point can be proved from the WAS test), of course, the ASP XML is not a database, because the database is specially optimized, and XML is just plain text, and the ASP is established to read all the XML data. In the memory, if the amount of data is large, it is conceivable that the speed will slow down. Then you will ask if I use the relationship data stock data, when is it to store data with XML? I will mention it here, that is, when the data is more complicated, I use XML data, and it is what you intend to read it in different operating systems. That is XML. If you are a normal data, don't you store data with an XML file when you don't support the database space or if you don't support the database. 2, XML data is easy to readily readily, txt text is more difficult to operate, we must read judgment in one line, and many features can not be real, can only prepare a relatively simple message, and XML data is different. With DOM, you can easily access each node, not TXT's annoying readline () witeline (), we can add to delete a node we are interested in, using ASP or JS or data islands to easily At this point, of course, I will use the ASP to read the XML data for the time of considering compatibility, and use the data island to read node data (because only IE5 or higher is supported by the data island technology) and use ASP. There is no such question because the customer gets the HTML file. 3, XML data boast system nature, as long as we store these data as XML then these data can be identified by the language or system, without doing what changes.
TXT obviously does not have these properties. For example, our message information on the Internet can be converted directly into the WAP format display on the phone. Fourth, establish the XML file (list.xml) of the store message information (List.xml) We don't plan to use DTD, because we are our own XML data, so you don't need DTD to verify (if you are interested in this, of course you can Add one this does not affect the operation of the program). Now let's take a look at the basic elements of the establishment of a message. Id. Id. - Defined as
<% Strsourcefile = server.mappath ("/") & "/list.xml" Gets the path to the XML file here, according to your virtual directory, different set objXml = server.createObject ("Microsoft.FreethreadedEdxmldom) 'is free Thread Create an XML ObjXML.Load (strsourceFile) 'Read XML file into memory set objrootsite = objxml.documentelement.selectsinglenode ("newlist")' Select NewList node%>