Hi There,
I tried the above example in MSDN, but could not get the expected result.
I am having a XML document and then 2 XSL doc's.
a)Sample.xml
b)StyleSheet1.xsl
c)StyleSheet2.xsl
What need to be done is :
1) Transform Sample.XML using StyleSheet1.xsl
to Result1
2) and then Transform Result1 using StyleSheet2.xsl to Result2.
Result is : After conversion the output file is
not the formatted file, instead the output contains the content of the of the XSL file.
The Code being used
Dim Source As New Msxml2.DOMDocument
Dim stylesheet As New Msxml2.DOMDocument
Dim stylesheet2 As New Msxml2.DOMDocument
Dim result As New Msxml2.DOMDocument
Dim result2 As New Msxml2.DOMDocument
' Load data.
Source.async = False
Source.Load "sample.xml"
' Load style sheet.
stylesheet.async = False
stylesheet.Load "stylesheet1.xsl"
' Set up the resulting document.
result.async = False
result.validateOnParse = True
result2.async = False
result2.validateOnParse = True
' Parse results into a result DOM Document.
Source.transformNodeToObject stylesheet, result
stylesheet2.async = False
stylesheet2.Load "stylesheet2.xsl"
result.transformNodeToObject stylesheet2,result2
MsgBox result2.xml
The sample file and style sheet can be found on the above URL.
Can some one help me on this.
Kindest regards,
Chris.G
I tried the above example in MSDN, but could not get the expected result.
I am having a XML document and then 2 XSL doc's.
a)Sample.xml
b)StyleSheet1.xsl
c)StyleSheet2.xsl
What need to be done is :
1) Transform Sample.XML using StyleSheet1.xsl
to Result1
2) and then Transform Result1 using StyleSheet2.xsl to Result2.
Result is : After conversion the output file is
not the formatted file, instead the output contains the content of the of the XSL file.
The Code being used
Dim Source As New Msxml2.DOMDocument
Dim stylesheet As New Msxml2.DOMDocument
Dim stylesheet2 As New Msxml2.DOMDocument
Dim result As New Msxml2.DOMDocument
Dim result2 As New Msxml2.DOMDocument
' Load data.
Source.async = False
Source.Load "sample.xml"
' Load style sheet.
stylesheet.async = False
stylesheet.Load "stylesheet1.xsl"
' Set up the resulting document.
result.async = False
result.validateOnParse = True
result2.async = False
result2.validateOnParse = True
' Parse results into a result DOM Document.
Source.transformNodeToObject stylesheet, result
stylesheet2.async = False
stylesheet2.Load "stylesheet2.xsl"
result.transformNodeToObject stylesheet2,result2
MsgBox result2.xml
The sample file and style sheet can be found on the above URL.
Can some one help me on this.
Kindest regards,
Chris.G