XML Web Server Control Overview
You can use the Xml Web server control to display the contents of an XML document without formatting or by using XSL transformations.
This topic contains:
You can use the XML Web server control to write an XML document, or the results of an XSLT transformation, into an ASP.ENT Web page. The XML output appears in the Web page at the location of the control.
To use XML data as the source for other controls, such as the Repeater, DataList, or GridView controls, you can use the XmlDataSource control. For details, see XmlDataSource Web Server Control Overview.
The XML and the XSLT information can be in external documents, or you can include the XML inline. There are two ways to reference external documents using property settings in the XML Web server control. You can provide a path to the XML document in the control tag, or you can programmatically load the XML and XSLT documents as objects and then pass them to the control. If you prefer to include the XML inline, write it between the opening and closing tags of the control.
The XML document to display is specified by setting one of properties listed in the following table. 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.
Sets the XML document by using a System.Xml.XmlDocument object.
Sets the XML document by using a string.
Sets the XML document by using a file.
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 set properties to specify an XSL Transformation (XSLT) style sheet that formats the XML document before it is written to the output stream. The properties represent the different types of XSL transformation style sheets that can be used to format the an 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 by using the default format.