Subject: RE: [xsl] Simple XML to XML transformation question From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx> Date: Thu, 18 Nov 2004 14:32:02 +0000 |
From: "Joe Heidenreich" <HeidenreichJ@xxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: RE: [xsl] Simple XML to XML transformation question Date: Thu, 18 Nov 2004 09:07:54 -0500
David Wrote: > view source in IE always shows the original source not the transform.
I was sort of thrown into the middle of learning XSLT from a pre-existing project. They handled their transforms like this:
Dim sourceFile, styleFile, source 'sourceFile = Server.GetFile() styleFile = Server.MapPath("style.xsl")
'Load the XML set source = Server.CreateObject("MSXML2.DOMDocument") source.async = false source.load(path)
' Load the XSL set style = Server.CreateObject("MSXML2.DOMDocument") style.async = false style.load styleFile
result = source.transformNode(style) Response.Write(result)
Which produces the transform in the browser, and by viewing the source you do see the transformed file. Even if the output method is XML, when the document is translated you will not see unknown elements in the browser, but they would show up in the source. Is this a bad practice? Is there a better way to be handling this?
I have since edited this code so that my output is written to a file instead of to a browser, but it would be a way to have the view source show the transform.
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Simple XML to XML transfo, Joe Heidenreich | Thread | [xsl] laying out list of nodes in 2, Wong Chin Shin |
[xsl] Sorting RTF, Paul Hebble | Date | [xsl] Profiling Number Ranges, Naomi Gronson |
Month |