[Home] [By Thread] [By Date] [Recent Entries]
From: "Joe Heidenreich" <HeidenreichJ@xxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: RE: Simple XML to XML transformation question Date: Thu, 18 Nov 2004 09:07:54 -0500 There are a few improvements that could be made. Firstly specify what class version to use, change: "MSXML2.DOMDocument" to "MSXML2.DOMDocument.4.0" if you have version 4, the latest, otherwise use "MSXML2.DOMDocument.3.0". Otherwise chnages on the server external to your app can change which parser you get Secondly it is more efficient to clone the second instance: set style = source.cloneNode(false) 'Next line not needed as second instance inherits first's 'style.async = false 'Next line is not needed with version 4 parser. style.setProperty "SelectionLanguage", "XPath" 'style.load styleFile Thirdly never do response.write if the whole page is produced via a transform, do: source.transformNodeToObject(style, Response) This will keep encodings as specified in stylesheet, otherwise you always get UTF-16. Fourthly you should set the content type to xml if the output is xml, then it will show in the browser: Response.ContentType = "text/xml" -- Joe
|

Cart



