C++ Programmer's Cookbook

{C++ 基础} {C++ 高级} {C#界面,C++核心算法} {设计模式} {C#基础}

csharp中xml引用xslt

使用xmldocument.createprocessinginstruction()方法。

using System;
using System.IO;
using System.Xml;

public class Sample
{
  
public static void Main()
  {
    XmlDocument doc 
= new XmlDocument();

    
// Create a procesing instruction.
    XmlProcessingInstruction newPI;
    String PItext 
= "type='text/xsl' href='book.xsl'";
    newPI 
= doc.CreateProcessingInstruction("xml-stylesheet", PItext);

    
// Display the target and data information.
    Console.WriteLine("<?{0} {1}?>", newPI.Target, newPI.Data);

    
// Add the processing instruction node to the document.
    doc.AppendChild(newPI);

  }
}

完!

posted on 2011-01-12 20:58 梦在天涯 阅读(2291) 评论(0)  编辑 收藏 引用 所属分类: C#/.NET

评论

# re: csharp中xml引用xslt 2011-08-29 14:58 梦在天涯

评论怎吗是-1啊  回复  更多评论   


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


公告

EMail:itech001#126.com

导航

统计

  • 随笔 - 461
  • 文章 - 4
  • 评论 - 746
  • 引用 - 0

常用链接

随笔分类

随笔档案

收藏夹

Blogs

c#(csharp)

C++(cpp)

Enlish

Forums(bbs)

My self

Often go

Useful Webs

Xml/Uml/html

搜索

  •  

积分与排名

  • 积分 - 1783577
  • 排名 - 5

最新评论

阅读排行榜