What you want to see on DotNetFunda.com ?
Go to DotNetFunda.com
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 1435 |  Welcome, Guest!   Register  Login
Home > Tutorials > ASP.NET Tutorials > Xml

Silverlight Tutorials | Report a Bug in the Tutorial
Found interesting? Add this to:


asp:Xml control
Xml control is used to load and transform Xml document.
 
Xml control is used to load and transform XML document. Following are some important properties that are very useful.
DocumentSource Path of the XML document to be used to write data.
TransformSource This must be a valid XSL Transform document. This is used to transform the XML document before its contents are written.
DEMO : Xml Show Source Code
NameSheo Narayan
Place Hyderabad, India
NameVijay Bandaru
Place Virginia, USA
NameJay Shankar
Place Aurangabad, India
NameDr. Sunita Narayan
Place Bokaro, India
NameSunil Kumar Prasad
Place Ranchi, India
NameSunita Shankar
Place Daudnagar, India
 
// Xml Control ///////////////////////////////////////////////////
<asp:Xml ID="Xml1" runat="Server" DocumentSource="~/tutorials/controls/controldata/XMLFile.xml" TransformSource="~/tutorials/controls/controldata/XSLTFile.xsl"></asp:Xml>

// XSL File //////////////////////////////////////////////////////
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/DotNetFunda">
    <xsl:apply-templates select="Writers" />
  </xsl:template>

  <xsl:template match="Writers">
  <table style="border:1px solid #456789;" cellpadding="2" cellspacing="1" width="100%">
    <tr aligh="left">
      <td style="width:20%;">Name</td>
      <td>
        <xsl:value-of select="Name"/>
      </td>
    </tr>
    <tr aligh="left">
      <td style="width:20%;">
        Place
      </td>
      <td>
        <xsl:value-of select="From"/>
      </td>
    </tr>
  </table>
</xsl:template>

</xsl:stylesheet> 

// XML File //////////////////////////////////////////////////////
<DotNetFunda>
  <Writers>
    <Name>Sheo Narayan</Name>
    <From>Hyderabad, India</From>
  </Writers>
  <Writers>
    <Name>Vijay Bandaru</Name>
    <From>Virginia, USA</From>
  </Writers>
  <Writers>
    <Name>Raheem Shaik</Name>
    <From>New York, USA</From>
  </Writers>
  <Writers>
    <Name>Jay Shankar</Name>
    <From>Aurangabad, India</From>
  </Writers>
  <Writers>
    <Name>Dr. Sunita Narayan</Name>
    <From>Bokaro, India</From>
  </Writers>
  <Writers>
    <Name>Sunil Kumar Prasad</Name>
    <From>Ranchi, India</From>
  </Writers>
  <Writers>
    <Name>Sunita Shankar</Name>
    <From>Daudnagar, India</From>
  </Writers>
</DotNetFunda>

                   
                    





About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/22/2013 7:51:54 PM