XslCompiledTransform.OutputSettings プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > XslCompiledTransform.OutputSettings プロパティの意味・解説 

XslCompiledTransform.OutputSettings プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

スタイル シートxsl:output 要素から派生した出力情報格納された XmlWriterSettings オブジェクト取得します

名前空間: System.Xml.Xsl
アセンブリ: System.Xml (system.xml.dll 内)
構文構文

Public ReadOnly Property
 OutputSettings As XmlWriterSettings
Dim instance As XslCompiledTransform
Dim value As XmlWriterSettings

value = instance.OutputSettings
public XmlWriterSettings OutputSettings { get;
 }
public:
property XmlWriterSettings^ OutputSettings {
    XmlWriterSettings^ get ();
}
/** @property */
public XmlWriterSettings get_OutputSettings ()
public function get OutputSettings
 () : XmlWriterSettings

プロパティ
スタイル シートxsl:output 要素から派生した出力情報格納された、読み取り専用XmlWriterSettings オブジェクト。この値は、null 参照 (Visual Basic では Nothing) の場合あります

解説解説
使用例使用例

OutputSettings プロパティ使用してコンソールテキスト書き込む XmlWriter オブジェクト作成する方法の例を次に示します

Imports System
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 = "outputConsole.xsl"
   
    
    Public Shared Sub Main()
 
        
        ' Create the XslTransform object and load the style sheet.
        Dim xslt As New
 XslCompiledTransform()
        xslt.Load(stylesheet)
        
        ' Load the file to transform.
        Dim doc As New XPathDocument(filename)
        
        ' Create the writer.             
        Dim writer As XmlWriter = XmlWriter.Create(Console.Out,
 xslt.OutputSettings)
        
        ' Transform the file and send the output to the console.
        xslt.Transform(doc, writer)
        writer.Close()
    
    End Sub 'Main 
End Class 'Sample 
using System;
using System.IO;
using System.Xml;
using System.Xml.Xsl;
using System.Xml.XPath;

public class Sample {

  private const String filename = "books.xml";
  private const String stylesheet = "outputConsole.xsl";

  public static void Main()
 {

    // Create the XslTransform object and load the style sheet.
    XslCompiledTransform xslt = new XslCompiledTransform();
    xslt.Load(stylesheet);

    // Load the file to transform.
    XPathDocument doc = new XPathDocument(filename);

    // Create the writer.             
    XmlWriter writer = XmlWriter.Create(Console.Out, xslt.OutputSettings);

    // Transform the file and send the output to the console.
    xslt.Transform(doc, writer);
    writer.Close();

  }
}

この例では、入力として、books.xml ファイルおよび outputConsole.xsl ファイル使用してます。

books.xml

<?xml version='1.0'?>
<!-- This file represents a fragment of a book store inventory database
 -->
<bookstore>
  <book genre="autobiography"
 publicationdate="1981" ISBN="1-861003-11-0">
    <title>The Autobiography
 of Benjamin Franklin</title>
    <author>
      <first-name>Benjamin</first-name>
      <last-name>Franklin</last-name>
    </author>
    <price>8.99</price>
  </book>
  <book genre="novel" publicationdate="1967"
 ISBN="0-201-63361-2">
    <title>The Confidence
 Man</title>
    <author>
      <first-name>Herman</first-name>
      <last-name>Melville</last-name>
    </author>
    <price>11.99</price>
  </book>
  <book genre="philosophy" publicationdate="1991"
 ISBN="1-861001-57-6">
    <title>The Gorgias</title>
    <author>
      <name>Plato</name>
    </author>
    <price>9.99</price>
  </book>
</bookstore>

outputConsole.xsl

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 version="1.0">
  <xsl:output method="text"
 omit-xml-declaration="yes"/>
  <xsl:template match="bookstore">
      Sorted Book Titles:
        <xsl:apply-templates select="book">
          <xsl:sort select="title"/>
        </xsl:apply-templates>
   </xsl:template>
  <xsl:template match="book">
          Title:  <xsl:value-of select="node()"/>
  </xsl:template>
</xsl:stylesheet>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
XslCompiledTransform クラス
XslCompiledTransform メンバ
System.Xml.Xsl 名前空間
その他の技術情報
XslCompiledTransform クラス使用


このページでは「.NET Framework クラス ライブラリ リファレンス」からXslCompiledTransform.OutputSettings プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からXslCompiledTransform.OutputSettings プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からXslCompiledTransform.OutputSettings プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

XslCompiledTransform.OutputSettings プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



XslCompiledTransform.OutputSettings プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS