XslTransform.Transform メソッド (String, String)
メモ : このメンバは旧バージョン用です。
XmlResolver を Transform() メソッドに渡す必要があります。
XML データを入力ファイルに変換し、その結果を出力ファイルに出力します。
<Obsolete("You should pass XmlResolver to Transform() method", _
False)>
Overloads Public Sub Transform( _ ByVal inputfile As String, _ ByVal outputfile As String _)
[C#]
[Obsolete("You should pass XmlResolver to Transform() method",
false)]
public void Transform(stringinputfile,stringoutputfile);
[C++]
[Obsolete("You should pass XmlResolver to Transform() method",
false)]
public: void Transform(String* inputfile,String* outputfile);
[JScript]
public
Obsolete("You should pass XmlResolver to Transform() method",
false)
function Transform(inputfile : String,outputfile : String);
パラメータ
- inputfile
変換するソース ドキュメントの URL。 - outputfile
出力ファイルの URL。
解説
XslTransform は、XSLT 1.0 構文をサポートしています。XSLT スタイル シートには、名前空間宣言 xmlns:xsl= http://www.w3.org/1999/XSL/Transform を含める必要があります。
Note[note] このメソッドは、.NET Framework Version 1.1 以降では使用しません。引数の 1 つとして XmlResolver オブジェクトを受け取る Transform メソッドを使用することをお勧めします。
使用例
[Visual Basic, C#, C++] output.xsl スタイルシートを使用して books.xml ファイルを変換し、その結果を books.html ファイルに出力する例を次に示します。
'Create the XslTransform object.
Dim xslt as XslTransform = new XslTransform()
'Load the stylesheet.
xslt.Load("output.xsl")
'Transform the file.
xslt.Transform("books.xml", "books.html")
[C#]
//Create the XslTransform object.
XslTransform xslt = new XslTransform();
//Load the stylesheet.
xslt.Load("output.xsl");
//Transform the file.
xslt.Transform("books.xml", "books.html");
[C++]
// Create the XslTransform object.
XslTransform* xslt = new XslTransform();
// Load the stylesheet.
xslt -> Load(S"output.xsl");
// Transform the file.
xslt -> Transform(S"books.xml", S"books.html");
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
参照
XslTransform クラス | XslTransform メンバ | System.Xml.Xsl 名前空間 | XslTransform.Transform オーバーロードの一覧 | XslTransform クラスの随意動作の実装 | XslTransform からの出力