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

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

Xml.TransformSource プロパティ

XML ドキュメント出力ストリーム書き込む前に書式設定する XSLT (Extensible Stylesheet Language Transformation) スタイル シートへのパス取得または設定します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Dim instance As Xml
Dim value As String

value = instance.TransformSource

instance.TransformSource = value
public string TransformSource { get;
 set; }
public:
property String^ TransformSource {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_TransformSource ()

/** @property */
public void set_TransformSource (String value)
public function get TransformSource
 () : String

public function set TransformSource
 (value : String)

プロパティ
XML ドキュメント出力ストリーム書き込む前に書式設定する XSL Transformation スタイル シートへのパス

解説解説

Xml コントロール使用して XML ドキュメント表示する場合は、オプション2 つ方法いずれか使用してXML ドキュメント出力ストリーム書き込む前に書式設定する XSL Transformation スタイル シート指定できますXML ドキュメントは、System.Xml.Xsl.XslTransform オブジェクトまたは XSL Transformation スタイル シート ファイル使用して書式設定できますXSL Transformation スタイル シート指定されていない場合XML ドキュメント既定書式表示されます。TransformSource プロパティは、XML ドキュメント出力ストリーム書き込む前に書式設定する場合使用される (XSL Transformation スタイル シートを表す) XSL Transformation スタイル シート ファイルへのパス指定するために使用します相対パスまたは絶対パス使用できます相対パスは、サーバー上の完全パス指定せずに、Web フォーム ページまたはユーザー コントロール位置ファイル位置関連付けます。このパスは、Web ページ位置対す相対パスです。これにより、コード内でファイルへのパス更新しなくても、サーバー上の別のディレクトリサイト全体簡単に移動できます絶対パスでは完全パス指定するため、サイトを他のディレクトリ移動する場合は、コード更新する必要があります

使用例使用例

Xml コントロールXSL Transform使用して XML ドキュメント表示する方法次のコード例示します

<!-- 
This sample shows an Xml control using the
DocumentSource and TransformSource properties to
 display Xml data
in the control.
Create a sample XML file called People.xml and 
and a sample XSL Transform file called Peopletable.xsl
using the code at the end of this sample.
-->

<%@ Page Language="VB" AutoEventWireup="True"
 %>
<%@ Import Namespace="System.Xml"
 %>
<%@ Import Namespace="System.Xml.Xsl"
 %>
<html>
<body>
   <h3>Xml Example</h3>
      <form>
          <asp:Xml id="xml1" runat="server"
 DocumentSource="~/people.xml"
          TransformSource="~/peopletable.xsl" />
     
      </form>
</body>
</html>

<!-- 
For this example to work, paste the following
 code into a file
named peopletable.xsl. Store the file in the same directory as
your .aspx file.

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:template match="/People">
      <xsl:apply-templates select="Person"
 />
   </xsl:template>
  
   <xsl:template match="Person">
      <table width="80%" border="1">
         <tr>
            <td>
               <b>
                  <xsl:value-of select="Name/FirstName"
 />
                  &#160;
                  <xsl:value-of select="Name/LastName"
 />
               </b>
            </td>
         </tr>
         <tr>
            <td>
               <xsl:value-of select="Address/Street"
 /><br />
               <xsl:value-of select="Address/City"
 />
               , 
               <xsl:value-of select="Address/State"
 /> 
               <xsl:value-of select="Address/Zip"
 />
            </td>
         </tr>
         <tr>
            <td>
               Job Title: <xsl:value-of select="Job/Title"
 /><br />
               Description: <xsl:value-of select="Job/Description"
 />
            </td>
         </tr>
      </table>
   </xsl:template>

   <xsl:template match="bookstore">
      <bookstore>
         <xsl:apply-templates select="book"/>
      </bookstore>
   </xsl:template>

   <xsl:template match="book">
      <book>
         <xsl:attribute name="ISBN">
            <xsl:value-of select="@ISBN"/>
         </xsl:attribute>
         <price>
            <xsl:value-of select="price"/>
         </price>
         <xsl:text>
         </xsl:text>
      </book>
   </xsl:template>

</xsl:stylesheet>


-->

<!--
For this example to work, paste the following
 code into a file 
named people.xml. Store the file in the same directory as
 
your .aspx file.

<?xml version="1.0" encoding="utf-8"
 ?>
<People>
   <Person>
      <Name>
         <FirstName>Joe</FirstName>
         <LastName>Suits</LastName>
      </Name>
      <Address>
         <Street>1800 Success Way</Street>
         <City>Redmond</City>
         <State>WA</State>
         <ZipCode>98052</ZipCode>
      </Address>
      <Job>
         <Title>CEO</Title>
         <Description>Runs the company</Description>
      </Job>
   </Person>

   <Person>
      <Name>
         <FirstName>Linda</FirstName>
         <LastName>Sue</LastName>
      </Name>
      <Address>
         <Street>1302 American St.</Street>
         <City>Paso Robles</City>
         <State>CA</State>
         <ZipCode>93447</ZipCode>
      </Address>
      <Job>
         <Title>Attorney</Title>
         <Description>Litigates trials</Description>
      </Job>
   </Person>

   <Person>
      <Name>
         <FirstName>Jeremy</FirstName>
         <LastName>Boards</LastName>
      </Name>
      <Address>
         <Street>34 Palm Avenue</Street>
         <City>Waikiki</City>
         <State>HI</State>
         <ZipCode>98052</ZipCode>
      </Address>
      <Job>
         <Title>Pro Surfer</Title>
         <Description>Rides waves</Description>
      </Job>
   </Person>

   <Person>
      <Name>
         <FirstName>Joan</FirstName>
         <LastName>Page</LastName>
      </Name>
      <Address>
         <Street>700 Webmaster Road</Street>
         <City>Redmond</City>
         <State>WA</State>
         <ZipCode>98073</ZipCode>
      </Address>
      <Job>
         <Title>Web Site Developer</Title>
         <Description>Writes ASP.NET pages</Description>
      </Job>
   </Person>
</People>

-->
<!-- 
This sample shows an Xml control using the
DocumentSource and TransformSource properties to display Xml data
in the control.
Create a sample XML file called People.xml and 
and a sample XSL Transform file called Peopletable.xsl
using the code at the end of this sample.
-->

<%@ Page Language="C#" AutoEventWireup="True" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Xml.Xsl" %>
<html>
<body>
   <h3>Xml Example</h3>
      <form>
          <asp:Xml id="xml1" runat="server" DocumentSource="~/people.xml"
          TransformSource="~/peopletable.xsl" />     
      </form>
</body>
</html>

<!-- 
For this example to work, paste the following code into a file
named peopletable.xsl. Store the file in the same directory as
your .aspx file.

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:template match="/People">
      <xsl:apply-templates select="Person" />
   </xsl:template>
  
   <xsl:template match="Person">
      <table width="80%" border="1">
         <tr>
            <td>
               <b>
                  <xsl:value-of select="Name/FirstName" />
                  &#160;
                  <xsl:value-of select="Name/LastName" />
               </b>
            </td>
         </tr>
         <tr>
            <td>
               <xsl:value-of select="Address/Street" /><br />
               <xsl:value-of select="Address/City" />
               , 
               <xsl:value-of select="Address/State" /> 
               <xsl:value-of select="Address/Zip" />
            </td>
         </tr>
         <tr>
            <td>
               Job Title: <xsl:value-of select="Job/Title" /><br
 />
               Description: <xsl:value-of select="Job/Description" />
            </td>
         </tr>
      </table>
   </xsl:template>

   <xsl:template match="bookstore">
      <bookstore>
         <xsl:apply-templates select="book"/>
      </bookstore>
   </xsl:template>

   <xsl:template match="book">
      <book>
         <xsl:attribute name="ISBN">
            <xsl:value-of select="@ISBN"/>
         </xsl:attribute>
         <price>
            <xsl:value-of select="price"/>
         </price>
         <xsl:text>
         </xsl:text>
      </book>
   </xsl:template>

</xsl:stylesheet>


-->

<!--
For this example to work, paste the following code into a file
 
named people.xml. Store the file in the same directory as 
your .aspx file.

<?xml version="1.0" encoding="utf-8" ?>
<People>
   <Person>
      <Name>
         <FirstName>Joe</FirstName>
         <LastName>Suits</LastName>
      </Name>
      <Address>
         <Street>1800 Success Way</Street>
         <City>Redmond</City>
         <State>WA</State>
         <ZipCode>98052</ZipCode>
      </Address>
      <Job>
         <Title>CEO</Title>
         <Description>Runs the company</Description>
      </Job>
   </Person>

   <Person>
      <Name>
         <FirstName>Linda</FirstName>
         <LastName>Sue</LastName>
      </Name>
      <Address>
         <Street>1302 American St.</Street>
         <City>Paso Robles</City>
         <State>CA</State>
         <ZipCode>93447</ZipCode>
      </Address>
      <Job>
         <Title>Attorney</Title>
         <Description>Litigates trials</Description>
      </Job>
   </Person>

   <Person>
      <Name>
         <FirstName>Jeremy</FirstName>
         <LastName>Boards</LastName>
      </Name>
      <Address>
         <Street>34 Palm Avenue</Street>
         <City>Waikiki</City>
         <State>HI</State>
         <ZipCode>98052</ZipCode>
      </Address>
      <Job>
         <Title>Pro Surfer</Title>
         <Description>Rides waves</Description>
      </Job>
   </Person>

   <Person>
      <Name>
         <FirstName>Joan</FirstName>
         <LastName>Page</LastName>
      </Name>
      <Address>
         <Street>700 Webmaster Road</Street>
         <City>Redmond</City>
         <State>WA</State>
         <ZipCode>98073</ZipCode>
      </Address>
      <Job>
         <Title>Web Site Developer</Title>
         <Description>Writes ASP.NET pages</Description>
      </Job>
   </Person>
</People>

-->
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「Xml.TransformSource プロパティ」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS