<%@language = "jscript"%>
<%
// fso를 사용하여 생성합니다
varfso = server.createobject ( "scripting.filesystemobject")
fso.createtextfile (Server.mappath ( "./" :/"))+"/ test1.xml"); // 파일 생성.
f = fso.getfile (Server.mappath ( "./" :/")+"/ test1.xml");
ts = f.openastextstream (2, -2);
ts.Write ( "<ute> <name>"+Escape ( "China"). 교체 (/%u (/w {4})/g, 함수 ($ 0, $ 1) {return "&#"+(( "0x"+$ 1) -0) .toString (10)+";"})+"</name>");
ts.Close ();
%>
<%
// adodb.strea를 사용하여 생성하십시오
varobjstream = server.createObject ( "adodb.stream")
(objstream)
{
유형 = 2;
모드 = 3;
열려 있는();
charset = "UTF-8";
위치 = objstream.size
writeText = "<root> <name>"+Escape ( "China"). 교체 (/%u (/w {4})/g, 함수 ($ 0, $ 1) {return "&#"+(( "0x"+$ 1) -0) .ToString (10)+";"})+"</name>";
Savetofile (Server.mappath ( "test2.xml"), 2)
닫다()
}
varobjstream = null;
%>
<%
<-
// Microsoft.dom을 사용하여 생성합니다
vardoc = newActivexObject ( "msxml2.dodocument"); // IE5.5+, createObject ( "microsoft.xmldom")
// 문서를로드합니다
//doc.load("test3.xml ");
// 파일 헤더를 만듭니다
varp = doc.CreateProcessingInstruction ( "xml", "version = '1.0'encoding ='utf-8 '");
// 파일 헤더 추가
Doc.AppendChild (P);
// 직접로드 할 때 루트 접점을 얻는 데 사용됩니다
//varroot=doc.documentElement;
// 루트 접점을 만드는 두 가지 방법
// varroot =
Doc.CreateElement ( "루트");
varroot = doc.createnode (1, "root", "");
// 자식 연락처 생성
varn = doc.createnode (1, "name", "");
// 하위 접촉 텍스트를 지정합니다
n.appendChild (Doc.CreateTextNode ( "중국"). 교체 (/%u (/w {4})/g, 함수 ($ 0, $ 1) {return "&#"+(( "0x"+$ 1) --0) .tostring (10)+";"});
// 자식 연락처 추가
root.appendChild (N);
// 연락처를 복사하십시오
// 데이터 세그먼트를 만듭니다