ASP.NET 2.0 Xml Control is used to load and transform XML documents. The following code creates an Xml control:
First of all, I have to say Microsoft ASP.NET team did a bad job by picking "Xml" as name of this control. An argument can be that the ASP.NET tag is asp:Xml but still, I would have picked a different name such as XmlWeb control or something.
XmlDocument property of Xml contrl can be used to set a XmlDocument object, which is created from an XML document. Another important property of Xml is DocumentSource, which can be set to an XML file and load the contents directly in the control.
The Transform property of Xml is used to set the transformation, which is an XslTransform object. The following code sets the Document and Transform property of Xml.
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
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: