At present, hosts that support ASP generally use Microsoft operating systems. In fact, win2k servers and above can be used. The following is an introduction to the process of using XMLDOM on servers that do not support FSO. Let’s learn about it together with the editor of the Wrong New Technology Channel!
Introduction to the process of using XMLDOM on servers that do not support FSO
First, let me explain it one thing. Pay attention to the normalization of HTML and XML code.
HTML
There is no problem with this, the standard writing should be
But if it is in xml
It is definitely wrong, because the node attribute value of XML is required to be in quotes.
same It's also wrong, because XML requires a closed node, you can write it as
,but It's also wrong, because XML is case sensitive
For input XML node, its TEXT value is empty, so it can be written as
This complies with the XML specification.
For example, in html
Write it in XML
or
Image in html
Write in XML
There are also special characters ",>,<,',&, nodes are not allowed to cross, etc. Let me say so much first. As for the standardization of XML documents, it is not the focus of this article, please refer to the relevant information.
I won't talk about how to use fso to generate an html file. But if you use FSO, your intention is to generate such an HTML file
I have written less here, and for HTML, the browser can tolerate it.
But to generate a document with XML specification, it must be
>>
How to save this XML-formatted document to the server?
dim xmlString
xmlString="" & chr(10) & "" & chr(10) & "
" & chr(10) & "" & chr(10) & "" & chr(10) & "
>
" & chr(10) & "" & chr(10) & ""
dim xmlDoc
set xmlDoc = server.createObject("Msxml2.DOMDocument")
xmlDoc.loadXml(xmlString)
xmlDoc.save(server.mappath("test.htm"))
set xmlDoc=nothing
The xmlDOM.loadXml() method is used here, which loads a piece of XML DOCUMENT into the object.
This is why you need to write the HTML you are preparing to generate into XML specifications, because the LOADXML() method only supports text strings that comply with XML specifications.
Of course, you need to have permission to write to the directory
Create HTML files
The above is a related introduction collected by the editor of the False New Technology Channel. I hope it will be helpful for you to understand the process of using XMLDOM on servers that do not support FSO!