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

Xml.Document プロパティ

メモ : このプロパティは、互換性のために残されています。

Xml コントロール内に表示される System.Xml.XmlDocument を取得または設定します

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

<ObsoleteAttribute("The recommended alternative is the XPathNavigator
 property. Create a System.Xml.XPath.XPathDocument and call CreateNavigator() to
 create an XPathNavigator. http://go.microsoft.com/fwlink/?linkid=14202")> _
Public Property Document As
 XmlDocument
Dim instance As Xml
Dim value As XmlDocument

value = instance.Document

instance.Document = value
[ObsoleteAttribute("The recommended alternative is the XPathNavigator property.
 Create a System.Xml.XPath.XPathDocument and call CreateNavigator() to create an
 XPathNavigator. http://go.microsoft.com/fwlink/?linkid=14202")] 
public XmlDocument Document { get; set;
 }
[ObsoleteAttribute(L"The recommended alternative is the XPathNavigator property.
 Create a System.Xml.XPath.XPathDocument and call CreateNavigator() to create an
 XPathNavigator. http://go.microsoft.com/fwlink/?linkid=14202")] 
public:
property XmlDocument^ Document {
    XmlDocument^ get ();
    void set (XmlDocument^ value);
}
/** @property */
public XmlDocument get_Document ()

/** @property */
public void set_Document (XmlDocument value)

プロパティ
Xml コントロール内に表示される System.Xml.XmlDocument

解説解説
使用例使用例

サンプル XML ファイルXSL Transformation スタイル シートから XmlDocument オブジェクトおよび XslTransform オブジェクト作成する方法次のコード例示します。これらのオブジェクトは、XML ドキュメント表示するために XML コントロール使用されます。

<!-- 
The following example demonstrates how to create XmlDocument and
 
XslTransform objects from the sample XML and XSL Transform files.
 
The objects are then used by the Xml control to
 display the XML 
document. Make sure the sample XML file is called People.xml and
 
the sample XSL Transform file is called Peopletable.xsl.
-->

<%@ Page Language="VB" AutoEventWireup="True"
 %>
<%@ Import Namespace="System.Xml"
 %>
<%@ Import Namespace="System.Xml.Xsl"
 %>
<html>
   <script runat="server">
      Sub Page_Load(sender As Object,
 e As EventArgs)
         Dim doc As XmlDocument = New
 XmlDocument()
         doc.Load(Server.MapPath("people.xml"))

         Dim trans As XslTransform = new
 XslTransform()
         trans.Load(Server.MapPath("peopletable.xsl"))

         xml1.Document = doc
         xml1.Transform = trans
      End Sub
</script>
<body>
   <h3>Xml Example</h3>
   <form runat="server">
      <asp:Xml id="xml1" runat="server"
 />
   </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="100%" 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">
      <!-- Prices and books -->
      <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.


<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>Wears the nice suit</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>Stands up for justice</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 the big 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 the pretty pages</Description>
      </Job>
   </Person>
</People>

-->
<!-- 
The following example demonstrates how to create XmlDocument and 
XslTransform objects from the sample XML and XSL Transform files. 
The objects are then used by the Xml control to display the XML 
document. Make sure the sample XML file is called People.xml and 
the sample XSL Transform file is called Peopletable.xsl.
-->

<%@ Page Language="C#" AutoEventWireup="True" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Xml.Xsl" %>
<html>
   <script runat="server">
      void Page_Load(Object sender, EventArgs e) 
      {
         XmlDocument doc = new XmlDocument();
         doc.Load(Server.MapPath("people.xml"));

         XslTransform trans = new XslTransform();
         trans.Load(Server.MapPath("peopletable.xsl"));

         xml1.Document = doc;
         xml1.Transform = trans;
      }
   </script>
<body>
   <h3>Xml Example</h3>
      <form runat="server">
         <asp:Xml id="xml1" runat="server" />
      </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="100%" 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">
      <!-- Prices and books -->
      <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.


<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>Wears the nice suit</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>Stands up for justice</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 the big 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 the pretty pages</Description>
      </Job>
   </Person>
</People>

-->
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Xml クラス
Xml メンバ
System.Web.UI.WebControls 名前空間
System.Xml.XmlDocument
DocumentContent
DocumentSource
Transform
TransformSource
その他の技術情報
XML Web サーバー コントロール

XmlDocument プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ Attributes  このノード属性格納している XmlAttributeCollection を取得します。 ( XmlNode から継承されます。)
パブリック プロパティ BaseURI オーバーライドされます現在のノードベース URI取得します
パブリック プロパティ ChildNodes  ノードすべての子ノード取得します。 ( XmlNode から継承されます。)
パブリック プロパティ FirstChild  ノード最初の子取得します。 ( XmlNode から継承されます。)
パブリック プロパティ HasChildNodes  このノード子ノードがあるかどうかを示す値を取得します。 ( XmlNode から継承されます。)
パブリック プロパティ InnerText  ノードとそのすべての子の連結された値を取得または設定します。 ( XmlNode から継承されます。)
パブリック プロパティ InnerXml オーバーライドされます現在のノードの子を表すマークアップ取得または設定します
パブリック プロパティ IsReadOnly オーバーライドされます現在のノード読み取り専用かどうかを示す値を取得します
パブリック プロパティ Item  オーバーロードされます指定した子要素取得します。 ( XmlNode から継承されます。)
パブリック プロパティ LastChild  ノード最後の子取得します。 ( XmlNode から継承されます。)
パブリック プロパティ LocalName オーバーライドされますノードローカル名を取得します
パブリック プロパティ Name オーバーライドされますノード限定名を取得します
パブリック プロパティ NamespaceURI  このノード名前空間 URI取得します。 ( XmlNode から継承されます。)
パブリック プロパティ NextSibling  このノード直後ノード取得します。 ( XmlNode から継承されます。)
パブリック プロパティ NodeType オーバーライドされます現在のノード種類取得します
パブリック プロパティ OuterXml  このノードとそのすべての子ノードを表すマークアップ取得します。 ( XmlNode から継承されます。)
パブリック プロパティ OwnerDocument オーバーライドされます現在のノード属する XmlDocument を取得します
パブリック プロパティ ParentNode オーバーライドされます。 このノード親ノード (親を持つノード場合) を取得します
パブリック プロパティ Prefix  このノード名前空間プリフィックス取得または設定します。 ( XmlNode から継承されます。)
パブリック プロパティ PreviousSibling  このノード直前ノード取得します。 ( XmlNode から継承されます。)
パブリック プロパティ SchemaInfo オーバーライドされますノードの PSVI (Post-Schema-Validation-Infoset) を返します
パブリック プロパティ Value  ノードの値を取得または設定します。 ( XmlNode から継承されます。)
パブリック プロパティ XmlResolver 外部リソース解決するために使用する XmlResolver を設定します
参照参照

関連項目

XmlDocument クラス
System.Xml 名前空間
XmlNodeChangedEventHandler

その他の技術情報

DOM への新しノード作成



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

辞書ショートカット

すべての辞書の索引

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

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

   

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



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

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

©2024 GRAS Group, Inc.RSS