One must find out what is needed in the end
Through ASP or other dynamic programming languages, we ultimately need XML-formatted data, which has nothing to do with the file carrier of the XML data, it can be a real XML file, such as: Http://www.dw8.cn/common/dw8.xml. It can also be an ASP document, such as: http://www.cnbruce.com/blog/rss2.asp
They are the embodiment of XML data, in order to realize the dynamic of XML data, so need to use a dynamic programming language, such as ASP to implement it.
Ii. How to generate a dynamic XML document
If the XML file is generated, the dynamic document is in ASP format, so you must use the FSO for the generation of XML files, such as:
The following is a reference fragment:
<%
Xmlfile=server.mappath ("Test1.xml")
Set fso = CreateObject ("Scripting.FileSystemObject")
Set MyFile = fso. CreateTextFile (Xmlfile,true)
MyFile.WriteLine ("")
MyFile.WriteLine ("< World >")
MyFile.WriteLine ("< hello >hello,world")
MyFile.WriteLine ("")
Myfile.close
%>
View XML File Contents
For an operation on the FSO see
http://www.cnbruce.com/blog/showlog.aspcat_id=26&log_id=440
In the case of generating dynamic XML data files, it is possible to control the name and value of the XML node by means of the program in the dynamic document by the MyFile.WriteLine related content.
Iii. how to generate XML data using dynamic documents
So if you're not generating an XML file and you're outputting XML data directly on a dynamic document, you need to declare the type of file (i.e. Response.ContentType)
<%response.contenttype = "Text/xml"%>
For example, directly browse the following dynamic ASP document, in the browser next to display as XML data tree
The following is a reference fragment:
<%
With Response
. ContentType = "Text/xml"
. Write ("")
. Write ("< World >")
. Write ("< hello >hello,world")
. Write ("")
End With
%>
The advantage of the generated XML file is that documents that process the XML data can be static documents, such as HTML files that parse XML through JavaScript, XMLDOM, and also ease data retention, while dynamic XML data on dynamic documents is not. However, in today's dynamic documents everywhere in the era, it seems that this advantage for some applications is not very influential, even, dynamic document XML data flow instead more advantages: more timely, more dynamic.