当前位置: 首页>>代码示例>>VB.NET>>正文


VB.NET XslTransform.Load方法代码示例

本文整理汇总了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
开发者ID:VB.NET开发者,项目名称:System.Xml.Xsl,代码行数:9,代码来源:XslTransform.Load

示例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
开发者ID:VB.NET开发者,项目名称:System.Xml.Xsl,代码行数:10,代码来源:XslTransform.Load

示例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
开发者ID:VB.NET开发者,项目名称:System.Xml.Xsl,代码行数:35,代码来源:XslTransform.Load

示例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
开发者ID:VB.NET开发者,项目名称:System.Xml.Xsl,代码行数:29,代码来源:XslTransform.Load

示例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
开发者ID:VB.NET开发者,项目名称:System.Xml.Xsl,代码行数:36,代码来源:XslTransform.Load

示例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
开发者ID:VB程序员,项目名称:System.Xml.Xsl,代码行数:15,代码来源:XslTransform.Load


注:本文中的System.Xml.Xsl.XslTransform.Load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。