[Home] [By Thread] [By Date] [Recent Entries]

  • From: s.livingstone@b...
  • To: xml-dev@l...
  • Date: Wed, 29 Aug 2001 23:34:07 +0100 (BST)

The following same changes the file test.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<steven>©</steven>

and changes the encoding as follows:

<?xml version="1.0" encoding="ISO-8859-1"?>
<steven>©</steven>

The script is..

set xmlDoc = server.createobject("Msxml2.DOMDocument.3.0")
xmlDoc.async = false
xmlDoc.validateOnParse = true
xmlDoc.load(server.MapPath("test.xml"))

set pi = xmlDoc.createProcessingInstruction("xml", "version='1.0' encoding='ISO-8859-1'")
xmlDoc.replaceChild pi,xmlDoc.childNodes.item(0)

xmlDoc.save(server.MapPath("test.xml"))

Whether standard or not, it works.

Cheers,
Steven
Author, Pro XML2e

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member