Generally, Windows (Windows 98SE or a later version) has an MSXML environment. the following asp code can be run, but it does not necessarily work. it may be because the style is http://www.w3.org/5o/form/transform, and the initial environment only supports http://ww.
Generally, Windows 98 SE and later versions have an MSXML environment. the following asp code can be run, but it does not necessarily work. it may be because the style sheet is disabled.
Reference content is as follows:
<% @ LANGUAGE = JScript %>
<%
// Set the source and style sheet locations here
Var sourceFile = Server. MapPath ("test. xml ");
Var styleFile = Server. MapPath ("test. xsl ");
// Load the XML
Var source = Server. CreateObject ("Microsoft. XMLDOM ");
Source. async = false;
Source. load (sourceFile );
// Load the XSL
Var style = Server. CreateObject ("Microsoft. XMLDOM ");
Style. async = false;
Style. load (styleFile );
Response. Write (source. transformNode (style ));
%>
Generally, MSXML is used as the development environment to create and install a new parser, such as MSXML 3 or MSXML 4 Technology Preview. after MSXML 3 is installed in the replace method, we can apply the following code:
Reference content is as follows:
<% @ LANGUAGE = JScript %>
<%
// Set the source and style sheet locations here
Var sourceFile = Server. MapPath ("test. xml ");
Var styleFile = Server. MapPath ("test. xsl ");
// Load the XML
Var source = Server. CreateObject ("Msxml2.DOMDocument ");
Source. async = false;
Source. load (sourceFile );
// Load the XSL
Var style = Server. CreateObject ("Msxml2.DOMDocument ");
Style. async = false;
Style. load (styleFile );
Response. Write (source. transformNode (style ));
%>
In this way, we get the development environment of MSXML 3, but if we don't want to damage the original environment, we have to test our example based on MSXML 3, although the replace method provides backward compatible methods to support XSL elements, functions, and XSL namespaces.
The actual application version has nothing to do with progIDs (version-dependent progIDs) to create an object instance can better complete the work, we do not need to use the replace method to install, use the side-by-side method, let's look at the following code:
Reference content is as follows:
<% @ LANGUAGE = JScript %>
<%
// Set the source and style sheet locations here
Var sourceFile = Server. MapPath ("test. xml ");
Var styleFile = Server. MapPath ("test. xsl ");
// Load the XML
Var source = Server. CreateObject ("Msxml2.DOMDocument. 3.0 ");
Source. async = false;
Source. load (sourceFile );
// Load the XSL
Var style = Server. CreateObject ("Msxml2.DOMDocument. 3.0 ");
Style. async = false;
Style. load (styleFile );
Response. Write (source. transformNode (style ));
%>
You only need to add version 3.0 to Msxml2.DOMDocument to apply MSXML 3, MSXML 4, and so on.
The same is true in the customer's real environment. The same is true for DOM objects created using js.
Reference content is as follows:
Function test (){
Var xmlDoc = new ActiveXObject ("Msxml2.DOMDocument. 3.0 ");
Var currNode;
XmlDoc. async = false;
XmlDoc. load ("test. xml ");
CurrNode = xmlDoc.doc umentElement. firstChild;
Alert (currNode. xml );
}
At last, the single side-by-side method of XSLT style is not supported in Internet Explorer 5.0 and later versions. If you want to apply IE 5 to open the XSLT style sheet, you need to install it using the replace method.