本文整理汇总了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