<% @ lingots = "jscript"%>
<%
// Utilisez FSO pour générer
varfso = server.createObject ("scripting.fileSystemObject")
fso.CreateTextFile (server.mappath ("./")+"/ test1.xml"); // créer le fichier.
f = fso.getfile (server.mappath ("./")+"/ test1.xml");
ts = f.OpenStSetStream (2, -2);
T.Write ("<hoot> <name>" + Escape ("China"). Remplacer (/% u (/ w {4}) / g, fonction (0 0, 1 1) {return "& #" + (("0x" + $ 1) -0) .toString (10) + ";"}) + "</name> </root>");
t.close ();
%>
<%
// utilise adodb.strea pour générer
varoBjstream = server.createObject ("adodb.stream")
avec (objstream)
{
Type = 2;
Mode = 3;
Ouvrir();
CharSet = "UTF-8";
Position = objstream.size
Writetext = "<hoot> <name>" + Escape ("China"). Remplace (/% u (/ w {4}) / g, fonction (0 0, 1 1) {return "& #" + (("0x" + $ 1) -0) .tostring (10) + ";"}) + "</name> </ root>";
SaveTofile (server.mappath ("test2.xml"), 2)
Fermer()
}
VaroBjstream = null;
%>
<%
<-
// utilise Microsoft.Dom pour générer
vardoc = newActivexObject ("msxml2.domDocument"); // ie5.5 +, createObject ("Microsoft.xmldom")
// Chargez le document
//doc.load("test3.xml ");
// Créer un en-tête de fichier
VARP = doc.CreateProcessingInStruche ("xml", "version = '1.0'encoding =' utf-8 '");
// Ajouter un en-tête de fichier
Doc.ApendChild (P);
// utilisé pour obtenir un contact racine lors du chargement directement
//varroot=doc.DocumentElement;
// deux façons de créer un contact racine
// Varroot =
doc.createElement ("root");
varroot = doc.creenode (1, "root", "");
// Créer un contact enfant
varn = doc.createtenode (1, "nom", "");
// Spécifiez le texte du sous-contact
n.appendChild (doc.createTextNode (Escape ("China"). Remplace (/% u (/ w {4}) / g, fonction (0 0, 1 1) {return "& #" + (("0x" + 1) -0) .tostring (10) + ";"})));
// Ajouter des contacts enfants
root.ApendChild (n);
// Copiez le contact
// Créer un segment de données