473,396 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

MSXML : i want to get the resultant HTML in a variable

Hi All
i m transforming a simple XSL file on Server side using MSXML Parser ...
and writting resultant HTML directly on browser .. is there any way to get
this HTML in a variable ???

i seen the article on MSDN but it makes my page blank ... plz edit my code
to make is work in this manner, if possible

Thankx in advance
Plz Help

'MY ASP FILE CODE
strxml = "<data><name>Asim</name></data>"
XSLFilePath = "C:\Emaples\test.xsl"

call TransformDocument(strXMl,XSLFilePath)

function TransformDocument(srcXML, srcXSL)
Dim sourceFile, styleFile, source
'the xsl file path
styleFile = srcXSL

set source = Server.CreateObject("MSXML2.DOMDocument")
source.async = false
source.loadXML srcXML
'Get The Style Object
set style = Server.CreateObject("MSXML2.DOMDocument")
style.async = false
style.load styleFile
'Error Handaling
if (source.parseError.errorCode <> 0) then
'result = reportParseError(source.parseError)
set oerr = source.parseError
sErrMsg = "XML Parsing Error. File: " & oErr.url & " Reason : " &
oErr.reason & " Line: " & oErr.line & ", Character: " & oErr.linepos & ",
Text: " & oErr.srcText
Response.Write sErrMsg
elseif (style.parseError.errorCode <> 0) then
'result = reportParseError(style.parseError)
set oerr = style.parseError
sErrMsg = "XML Parsing Error. File: " & oErr.url & " Reason : " &
oErr.reason & " Line: " & oErr.line & ", Character: " & oErr.linepos & ",
Text: " & oErr.srcText
Response.Write sErrMsg
else
source.transformNodeToObject style,Response
end if
End Function

'MY XSL FILE CODE
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" version="4.0" encoding="utf-8"/>
<xsl:variable name="name">??!</xsl:variable>
<xsl:template match="data">
<html>
<head><META http-equiv="Content-Type" content="text/html;
charset=utf-8"/></head>
<body>
<hr/>
Name from XML is : <xsl:value-of select="//name"/>
<hr/>
Variable/Contant Value from XSL is : <xsl:value-of select="$name"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Jul 19 '05 #1
0 1993

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Val Melamed | last post by:
Hi all, These days I'm playing with schemas and SOM from MSXML. To learn it I used the excellent tutorial from Mr.Costello: http://www.xfront.com/xml-schema.html. while working through the...
7
by: Peter | last post by:
I have noticed a difference in the processing of XSL transforms between dotnet and MSXML. Dotnet formats the resulting output differently, and since we use the <pre> tag in the HTML output it makes...
19
by: Mark Miller | last post by:
QUESTION: Does anyone know how I can use v2.6 of the MSXML parser with .NET? BACKGROUND: I "Web to Print" process that allows our clients (newspapers) to export their data and pass it thru a...
6
by: Alfred Taylor | last post by:
I'm having performance/memory problems using .NET's XslTransform class so I thought I'd give the MSXML object's a whirl. The question I haven't been able to find in these groups is can I use C#...
11
by: Lucky | last post by:
hi guys, i need to parse html data that i've got from "Inet" object in vb6. now i want to prase the html data. here i got 2 options. one is MSXML and other is MSHTML. i tried both of them but i...
1
by: Ken Fine | last post by:
I'm using ASP VB. I want to insert a VbCr or a VbLf into a declared string every N characters. FWIW, I want to do this because of an apparent limitation in MSXML2, which I am using to "scrape" data...
3
by: Sharon | last post by:
How can I find what MSXML version I have installed? -- Thanks Sharon
13
by: yawnmoth | last post by:
<http://www.quirksmode.org/book/printable/xmlhttp.txtshows two alternatives to Microsoft.XMLHTTP - Msxml2.XMLHTTP and Msxml3.XMLHTTP. If my understanding is correct, the different numbers refer to...
5
by: Jeroen | last post by:
We're using MSXML to transform the XML document we have to an XHTML file using an XSLT. Now the problem is that the dotnet implementation we made does something subtly different from the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.