Xml.TransformSource プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As Xml Dim value As String value = instance.TransformSource instance.TransformSource = 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" />   <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" />   <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> -->

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からXml.TransformSource プロパティを検索する場合は、下記のリンクをクリックしてください。

- Xml.TransformSource プロパティのページへのリンク