I have to Transform xml to xml/html using Saxon_1.NET-1.0-RC1 within VB.NET.
Coding for the same:
Try
Dim xslStream As New javax.xml.transform.stream.StreamSource(New java.io.File("mstrInputXSLTFile"))
Dim xmlStream As New javax.xml.transform.stream.StreamSource(New java.io.File("mstrInputXMLFile"))
Dim out As New javax.xml.transform.stream.StreamResult(New java.io.File("mstrOutputXMLFile"))
Dim t As javax.xml.transform.TransformerFactory = net.sf.saxon.TransformerFactoryImpl.newInstance()
Dim transformer As javax.xml.transform.Transformer = t.newTransformer()
transformer.transform(xmlStream, out)
Cursor.Current = Cursors.Default
MessageBox.Show("Data has been successfully Transform.", "Transformation Complete", MessageBoxButtons.OK, MessageBoxIcon.Information)
transformer = Nothing
Catch ex As Exception
Cursor.Current = Cursors.Default
MessageBox.Show(ex.Message, "Error Transforming Data", MessageBoxButtons.OK, MessageBoxIcon.Stop)
End Try
With the above code I can't able to transform also not generating output.
Can anyone help me for the same.
Thanks,
Shailesh
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All,
I have to Transform xml to xml/html using Saxon_1.NET-1.0-RC1 within VB.NET.
Coding for the same:
Try
Dim xslStream As New javax.xml.transform.stream.StreamSource(New java.io.File("mstrInputXSLTFile"))
Dim xmlStream As New javax.xml.transform.stream.StreamSource(New java.io.File("mstrInputXMLFile"))
Dim out As New javax.xml.transform.stream.StreamResult(New java.io.File("mstrOutputXMLFile"))
Dim t As javax.xml.transform.TransformerFactory = net.sf.saxon.TransformerFactoryImpl.newInstance()
Dim transformer As javax.xml.transform.Transformer = t.newTransformer()
transformer.transform(xmlStream, out)
Cursor.Current = Cursors.Default
MessageBox.Show("Data has been successfully Transform.", "Transformation Complete", MessageBoxButtons.OK, MessageBoxIcon.Information)
transformer = Nothing
Catch ex As Exception
Cursor.Current = Cursors.Default
MessageBox.Show(ex.Message, "Error Transforming Data", MessageBoxButtons.OK, MessageBoxIcon.Stop)
End Try
With the above code I can't able to transform also not generating output.
Can anyone help me for the same.
Thanks,
Shailesh