本文整理匯總了VB.NET中System.Xml.Xsl.XslTransform.Load方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET XslTransform.Load方法的具體用法?VB.NET XslTransform.Load怎麽用?VB.NET XslTransform.Load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.Xsl.XslTransform
的用法示例。
在下文中一共展示了XslTransform.Load方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: TransformFile
public shared sub TransformFile (xsltNav as XPathNavigator)
' Load the stylesheet.
Dim xslt as XslTransform = new XslTransform()
xslt.Load(xsltNav, nothing, nothing)
' Transform the file.
xslt.Transform("books.xml", "books.html", nothing)
end sub
示例2: TransformFile
public shared sub TransformFile (xsltReader as XmlReader, secureURL as String)
' Load the stylesheet using a default XmlUrlResolver and Evidence
' created using the trusted URL.
Dim xslt as XslTransform = new XslTransform()
xslt.Load(xsltReader, new XmlUrlResolver(), XmlSecureResolver.CreateEvidenceForUrl(secureURL))
' Transform the file.
xslt.Transform("books.xml", "books.html", new XmlUrlResolver())
end sub
示例3: Sample
' 導入命名空間
Imports System.IO
Imports System.Xml
Imports System.Xml.Xsl
Imports System.Xml.XPath
public class Sample
private const filename as String = "books.xml"
private const stylesheet as String = "titles.xsl"
public shared sub Main()
'Create the reader to load the stylesheet.
'Move the reader to the xsl:stylesheet node.
Dim reader as XmlTextReader = new XmlTextReader(stylesheet)
reader.Read()
reader.Read()
'Create the XslTransform object and load the stylesheet.
Dim xslt as XslTransform = new XslTransform()
xslt.Load(reader)
'Load the file to transform.
Dim doc as XPathDocument = new XPathDocument(filename)
'Create an XmlTextWriter which outputs to the console.
Dim writer as XmlTextWriter = new XmlTextWriter(Console.Out)
'Transform the file and send the output to the console.
xslt.Transform(doc, nothing, writer)
writer.Close()
end sub
end class
示例4: Sample
Option Strict
Option Explicit
Imports System.IO
Imports System.Xml
Imports System.Xml.Xsl
Imports System.Xml.XPath
Public Class Sample
Private Shared filename1 As String = "books.xml"
Private Shared stylesheet1 As String = "output.xsl"
Public Shared Sub Main()
'Load the stylesheet.
Dim xslt As New XslTransform()
xslt.Load(stylesheet1)
'Load the file to transform.
Dim doc As New XPathDocument(filename1)
'Create an XmlTextWriter which outputs to the console.
Dim writer As New XmlTextWriter(Console.Out)
'Transform the file and send the output to the console.
xslt.Transform(doc, Nothing, writer, Nothing)
writer.Close()
End Sub
End Class
示例5: Sample
' 導入命名空間
Imports System.IO
Imports System.Xml
Imports System.Xml.XPath
Imports System.Xml.Xsl
Imports System.Net
public class Sample
private shared filename as String = "books.xml"
private shared stylesheet as String = "sort.xsl"
public shared sub Main()
'Create the XslTransform.
Dim xslt as XslTransform = new XslTransform()
'Create a resolver and set the credentials to use.
Dim resolver as XmlUrlResolver = new XmlUrlResolver()
resolver.Credentials = CredentialCache.DefaultCredentials
'Load the stylesheet.
xslt.Load(stylesheet, resolver)
'Load the XML data file.
Dim doc as XPathDocument = new XPathDocument(filename)
'Create the XmlTextWriter to output to the console.
Dim writer as XmlTextWriter = new XmlTextWriter(Console.Out)
'Transform the file.
xslt.Transform(doc, nothing, writer, nothing)
writer.Close()
end sub
end class
示例6: SymEnc
' 導入命名空間
Imports System.Xml.Xsl
Public Class SymEnc
Public Shared Sub Main(ByVal CmdArgs() As String)
Dim myXslTransform As XslTransform = New XslTransform()
Dim destFileName As String = "ShowIt.html"
myXslTransform.Load("xsltFile.xslt")
myXslTransform.Transform("xmlFile.xml", destFileName)
System.Diagnostics.Process.Start(destFileName)
End Sub
End Class