Xml Class
Assembly: System.Web (in system.web.dll)
Use the Xml control to display the contents of an XML document without formatting or using XSL Transformations.
The XML document to display is specified by setting one of three properties. These three properties represent the different types of XML documents that can be displayed. You can display a System.Xml.XmlDocument, an XML string, or an XML file by setting the appropriate property. The following table lists the properties for specifying the XML document.
| Property | Description | ||
|---|---|---|---|
| Sets the XML document using a System.Xml.XmlDocument object. | |||
| Sets the XML document using a string.
| |||
| Sets the XML document using a file. |
Note |
|---|
| At least one of the XML document properties must be set to display an XML document. If more than one XML document property is set, the XML document referenced in the last property set is displayed. The documents in the other properties are ignored. |
You can optionally specify an XSL Transformation (XSLT) style sheet that formats the XML document before it is written to the output stream by setting one of two properties. The two properties represent the different types of XSL Transformation style sheets that can be used to format the XML document. You can format the XML document with a System.Xml.Xsl.XslCompiledTransform object or with an XSL Transformation style sheet file by setting the appropriate property. If no XSL Transformation style sheet is specified, the XML document is displayed using the default format. The following table lists the properties for specifying an XSL Transformation style sheet.
| Property | Description |
|---|---|
| Formats the XML document using the specified System.Xml.Xsl.XslTransform object. | |
| Formats the XML document using the specified XSL Transformation style sheet file. |
Note |
|---|
| The XSL Transformation style sheet is optional. You do not need to set the Transform or the TransformSource property. If both XSL Transformation style sheet properties are set, the last property set determines which XSL Transformation style sheet is used to format the XML document. The other property is ignored. |
The Xml class also provides the TransformArgumentList property, which allows you to provide the XSL Transformation style sheet with optional arguments. The arguments can be either XSL Transformations (XSLT) parameters or extension objects.
| Topic | Location |
|---|---|
| How to: Add XML Web Server Controls to a Web Forms Page | Building ASP .NET Web Applications |
| How to: Load XML Data in the XML Web Server Control | Building ASP .NET Web Applications |
| How to: Transform XML Data in the XML Web Server Control | Building ASP .NET Web Applications |
| How to: Load XML Data in the XML Web Server Control | Building ASP .NET Web Applications |
| How to: Transform XML Data in the XML Web Server Control | Building ASP .NET Web Applications |
| How to: Add XML Web Server Controls to a Web Forms Page (Visual Studio) | Building ASP .NET Web Applications in Visual Studio |
| Walkthrough: Creating a Web Page to Display XML Data | Building ASP .NET Web Applications in Visual Studio |
| Walkthrough: Displaying an XML Document in a Web Forms Page Using Transformations | Building ASP .NET Web Applications in Visual Studio |
- AspNetHostingPermission for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
- AspNetHostingPermission for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.
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
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Note