当前位置: 首页>>代码示例>>C#>>正文


C# XslCompiledTransform.Load方法代码示例

本文整理汇总了C#中System.Xml.Xsl.XslCompiledTransform.Load方法的典型用法代码示例。如果您正苦于以下问题:C# XslCompiledTransform.Load方法的具体用法?C# XslCompiledTransform.Load怎么用?C# XslCompiledTransform.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.Xsl.XslCompiledTransform的用法示例。


在下文中一共展示了XslCompiledTransform.Load方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: XmlUrlResolver

// Create a resolver and specify the necessary credentials.
XmlUrlResolver resolver = new XmlUrlResolver();
System.Net.NetworkCredential myCred;
myCred  = new System.Net.NetworkCredential(UserName,SecurelyStoredPassword,Domain);  
resolver.Credentials = myCred;
  
// Load the style sheet.
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(new XPathDocument("http://serverName/data/xsl/sort.xsl"), XsltSettings.Default, resolver);
开发者ID:.NET开发者,项目名称:System.Xml.Xsl,代码行数:9,代码来源:XslCompiledTransform.Load

示例2: XslCompiledTransform

// Create the XslCompiledTransform object.
XslCompiledTransform xslt = new XslCompiledTransform();

// Create a resolver and set the credentials to use.
XmlSecureResolver resolver = new XmlSecureResolver(new XmlUrlResolver(), "http://serverName/data/");
resolver.Credentials = CredentialCache.DefaultCredentials;
  
// Load the style sheet.
xslt.Load("http://serverName/data/xsl/sort.xsl", null, resolver);
开发者ID:.NET开发者,项目名称:System.Xml.Xsl,代码行数:9,代码来源:XslCompiledTransform.Load

示例3: Main

//引入命名空间
using System;
using System.IO;
using System.Reflection;
using System.Xml;
using System.Xml.Xsl;

class Example
{
    static void Main()
    {
        // Load a stylesheet compiled using the XSLTC.EXE utility
        Type compiledStylesheet = Assembly.Load("Transform").GetType("Transform");

        // Extract private members from the compiled stylesheet
        BindingFlags bindingFlags = BindingFlags.NonPublic | BindingFlags.Static;
        MethodInfo executeMethod = compiledStylesheet.GetMethod("Execute", bindingFlags);
        object staticData = compiledStylesheet.GetField("staticData", bindingFlags).GetValue(null);
        object earlyBoundTypes = compiledStylesheet.GetField("ebTypes", bindingFlags).GetValue(null);

        // Load into XslCompiledTransform
        XslCompiledTransform xslt = new XslCompiledTransform();
        xslt.Load(executeMethod, (byte[])staticData, (Type[])earlyBoundTypes);

        // Run the transformation
        xslt.Transform(XmlReader.Create(new StringReader("<Root><Price>9.50</Price></Root>")), (XsltArgumentList)null, Console.Out);
    }
}
开发者ID:.NET开发者,项目名称:System.Xml.Xsl,代码行数:28,代码来源:XslCompiledTransform.Load

示例4: XslCompiledTransform

// Create the XslCompiledTransform object.
XslCompiledTransform xslt = new XslCompiledTransform();

// Create a resolver and set the credentials to use.
XmlSecureResolver resolver = new XmlSecureResolver(new XmlUrlResolver(), "http://serverName/data/");
resolver.Credentials = CredentialCache.DefaultCredentials;
  
XmlReader reader = XmlReader.Create("http://serverName/data/xsl/sort.xsl");

// Create the XsltSettings object with script enabled.
XsltSettings settings = new XsltSettings(false,true);

// Load the style sheet.
xslt.Load(reader, settings, resolver);
开发者ID:.NET开发者,项目名称:System.Xml.Xsl,代码行数:14,代码来源:XslCompiledTransform.Load

示例5: XslCompiledTransform

// Create a reader that contains the style sheet.
XmlReader reader = XmlReader.Create("titles.xsl");
reader.ReadToDescendant("xsl:stylesheet");

// Load the style sheet.
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(reader);
开发者ID:.NET开发者,项目名称:System.Xml.Xsl,代码行数:7,代码来源:XslCompiledTransform.Load

示例6: XslCompiledTransform

// Load the style sheet.
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load("output.xsl");

// Execute the transform and output the results to a file.
xslt.Transform("books.xml", "books.html");
开发者ID:.NET开发者,项目名称:System.Xml.Xsl,代码行数:6,代码来源:XslCompiledTransform.Load

示例7: Main

//引入命名空间
using System;
using System.Xml.Xsl;

class MainClass {
    public static void Main() {
        XslCompiledTransform transform = new XslCompiledTransform();

        transform.Load("orders.xslt");
        transform.Transform("orders.xml", "orders.html");
    }
}
开发者ID:C#程序员,项目名称:System.Xml.Xsl,代码行数:12,代码来源:XslCompiledTransform.Load


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