XmlDocument..::.CreateProcessingInstruction
来源:互联网 发布:java编译成class工具 编辑:程序博客网 时间:2024/06/16 16:32
.NET Framework 类库
XmlDocument..::.CreateProcessingInstruction 方法
更新:2007 年 11 月
创建一个具有指定名称和数据的 XmlProcessingInstruction。
程序集: System.Xml(在 System.Xml.dll 中)
![](http://i.msdn.microsoft.com/Global/Images/clear.gif)
Visual Basic(声明)
Public Overridable Function CreateProcessingInstruction ( _ target As String, _ data As String _) As XmlProcessingInstruction
Visual Basic (用法)
Dim instance As XmlDocumentDim target As StringDim data As StringDim returnValue As XmlProcessingInstructionreturnValue = instance.CreateProcessingInstruction(target, _ data)
C#
public virtual XmlProcessingInstruction CreateProcessingInstruction( string target, string data)
Visual C++
public:virtual XmlProcessingInstruction^ CreateProcessingInstruction( String^ target, String^ data)
J#
public XmlProcessingInstruction CreateProcessingInstruction( String target, String data)
JScript
public function CreateProcessingInstruction( target : String, data : String) : XmlProcessingInstruction
![](http://i.msdn.microsoft.com/Global/Images/clear.gif)
![](http://i.msdn.microsoft.com/Global/Images/clear.gif)
下面的示例创建一个 ProcessingInstruction 节点并将其添加到文档中。
Visual Basic
Imports SystemImports System.IOImports System.Xmlpublic class Sample public shared sub Main() Dim doc as XmlDocument = new XmlDocument() ' Create a procesing instruction. Dim newPI as XmlProcessingInstruction Dim PItext as String = "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) end subend class
C#
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); }}
Visual C++
#using <System.Xml.dll>using namespace System;using namespace System::IO;using namespace System::Xml;int main(){ XmlDocument^ doc = gcnew 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 );}
J#
import System.*;import System.IO.*;import System.Xml.*;public class Sample{ public static void main(String[] args) { 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.get_Target(), newPI.get_Data()); // Add the processing instruction node to the document. doc.AppendChild(newPI); } //main} //Sample
![](http://i.msdn.microsoft.com/Global/Images/clear.gif)
Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。![](http://i.msdn.microsoft.com/Global/Images/clear.gif)
- XmlDocument..::.CreateProcessingInstruction
- XmlDocument
- XMLDocument操作
- xmlDocument是什么?
- XmlDocument使用
- XmlDocument类
- XmlDocument/XmlTextWriter
- 精通XMLDocument
- xmldocument操作
- XmlDocument & XDocment
- XmlDocument类
- XmlDocument类
- C# XMLDocument
- XmlDocument类
- XmlDocument类
- XmlDocument类
- XmlDocument类
- XmlDocument xmldoc = new XmlDocument();
- java中抽象类和接口的几点区别
- 隱藏GridView 欄位
- 急找LOTUS的同行
- 如今找一个好的程序员真难啊!
- Cross Compile "bluez-4.18" Arm-xScale Platform (原创)
- XmlDocument..::.CreateProcessingInstruction
- 在程序中访问OutputDebugString的信息
- “由于代码已经过优化或者本机框架位于调用堆栈之上,无法计算表达式的值。”
- MySQL字符集问题解决方法(包括改配置文件、命令行修改和JDBC的问题)
- 网络管理技术核心:保证关键业务持续性
- core dump
- 内核调试的问题
- 假招聘内幕:我们根本不需要很多人
- Harmonious layouts for n queens in a n*n chessboard