Hi,
I'm consuming a webservice which returns an XMLNode with VB.NET and XSLT and
sending the output to Response.OutputStream
If I feed the returned XMLNode directly in the transform method, I get an
error:
System.InvalidOperationException: The specified node cannot be inserted as
the valid child of this node, because the specified node is the wrong type.
If I first serialize the node to a string and then load a new document with
that string it works fine. Can anybody explain me why that is?
Thanx,
Corno
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim webservice As New webservice.main
Dim source As XmlNode = webservice.getXMLFile()
'IF I LEAVE THE NEXT FOUR LINES OUT, I GET THE ERROR
Dim intermediateString As String = source.OuterXml
Dim intermediateDoc As New XmlDocument
intermediateDoc.LoadXml(intermediateString)
source = intermediateDoc
Dim xslDoc As New XslTransform
xslDoc.Load(Server.MapPath("test.xslt"))
xslDoc.Transform(source, Nothing, Response.OutputStream, Nothing)
End Sub