XML Control

XML Control

Previous Home Next

 

The XML control is used to display an XML document or the results of an XSL Transform.
At least one of the XML Document properties must be set or no XML document is displayed.You can also specify an XSLT document that will format the XML document before it is written to the output. You can format the XML document with the Transform property or the TransformSource property.

Steps:
1. Open a new web project,Add a new form and add drag and drop the XML control on the form.
2. Second to the project add an xml file called XMLFile.xml.
3. Add an XSLTFile.xslt file to the project.
4. The xml file has data for the Person of Academic Qualification Profile Group.
5. Let us set the values of DocumentSource of the XML object to XMLFile.xml.
6. You should see the list of all the records present in the  XMLFile.
7. The records a shown in flat style one after the other. Definitely the user would not want to view the records in a liner format as above. WE need to display the records to the user in a tabular format separating the records.
8. Now let us set the value for Transformsource. Select the XSLTFile.xslt we created.
9. Compile and build and execute the project.you will view a tabulr record.

 
  

 The DocumentSource property is used to set or return the path to an XML document to display in the Xml control.

 Specifies a path to an XSL Transform file.

 The match attribute can also be used to define a template for the entire XML document. The value of the match attribute is an XPath expression (i.e. match="/" defines the whole document).

 XML Control Design
***********************************************************************
*************

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="XML.aspx.cs" Inherits="_Default" %>




    XML


    
************************************************************************ XML.xml File Code ************************************************************************ ******** Aditya From Jaunpur From Jaunpur From Jaunpur From Ghaziabad Kamal From Gonda From Gonda From Balram Pur From Ghaziabad Sonal From Kanpur From Kanpur From Kanur From Ghaziabad ********************************************************************* XSLT File Code *********************************************************************** *********

Academic Qualification

Name 10th 12th B.Sc MCA
Previous Home Next