VB.Net by API/System.Xml.Xsl/XslCompiledTransform

Материал из VB Эксперт
Перейти к: навигация, поиск

XslCompiledTransform.Load

  
Imports System.Xml.Xsl " contains class XslCompiledTransform
Public Class Tester
    Public Shared Sub Main
      Dim transformer As XslCompiledTransform
      transformer = New XslCompiledTransform() " create transformer
      transformer.Load("YOurFile.xsl") " load and compile the style sheet
      transformer.Transform("YOurFile.xml", "YOurFile.html")
      Console.WriteLine(System.IO.File.ReadAllText("YOurFile.html"))
    End Sub
End Class


XslCompiledTransform.Transform

  
Imports System.Xml.Xsl " contains class XslCompiledTransform
Public Class Tester
    Public Shared Sub Main
      Dim transformer As XslCompiledTransform
      transformer = New XslCompiledTransform() " create transformer
      transformer.Load("YOurFile.xsl") " load and compile the style sheet
      transformer.Transform("YOurFile.xml", "YOurFile.html")
      Console.WriteLine(System.IO.File.ReadAllText("YOurFile.html"))
    End Sub
End Class