Some friends' hosts do not support FSO, but it is also difficult to generate an HTML file. Is it difficult?
Today's hosts that support ASP generally use Microsoft OS, and these OS are generally Win2K Server and above, even if the XML Parser is not installed, XML Parser resolution is also supported.
And XMLDOM also has a .save method. Through this we can generate an HTML file on the host that is not fso.
First, a little. Note the normalization of HTML and XML code.
HTML
This is no problem, the standard write should be
But if it is XML
is definitely wrong because the XML node property value requires within quotation marks.
Also is also wrong, because XML needs to be closed, you can write
INPUT>, but input> is also wrong because XML is case sensitive
For input this XML node, its text value is empty, so you can write
This is in line with the XML specification.
For example, in HTML
is written in XML
or
Image in HTML
Write
There are also special characters ",>, <, ', &, nodes are not allowed to cross, etc., first say so much, as for the XML documentation is not the focus of this article, please refer to the relevant information.
How to generate an HTML file with FSO here. But if you use FSO, your Cornership is to generate such an HTML file.
body>
html>
It is less written here head>, for HTML, the browser can tolerate.
But to generate a document with XML specification, it must be
hEAD>
p>
body>
html>
How to store this XML formatted document into the server?
DIM Xmlstring
Xmlstring = "" & chr (10) & "
" & chr (10) & "p>" & chr (10) & " body>" & chr (10) & " html>" DIM XMLDOC
Set Xmldoc = Server.createObject ("msxml2.domdocument")
XMLDoc.LoadXML (Xmlstring)
XMLDoc.save (Server.MAppath ("Test.htm"))
SET Xmldoc = Nothing
Here is an XMLDom.LoadXML () method, which loads a paragraph XML Document to the object.
Why do you want to be prepared to generate the HTML to write a XML specification because the loadXML () method only supports text strings that meet XML specifications.
Of course, you need to have write rights to the directory.
Source: DVBBS