Using XML and XSLT in ASP.Net pageXSLT is used to transform XML document into an ordinary web page where you would have applied the style information for formatting the data that you have got from the xml file.
To work in XML, XSLT in an ASP.Net page, first create the xml file that has the data needed and then create the xsl file that has the style information and details on how to display the data found in the xml file. Once this file is also created, you can work with ASP.Net to get is displayed. If you find it difficult to work with xslt files for the xml files, then you can use tools like XML Spy to create. They can also be created in Visual Studio .Net. Import the namespaces, System.Xml and System.Xml.Xsl in the code view of the ASP.Net page. Now create an XmlDocument object and use the Load method available for that document object to load the xml file. Now create a XslTransform object and load the xslt file in it. Before doing these two steps, drag an xml server control into your aspx page. Now assign the Document property of the xml server control to that of the XmlDocument object and the Transform property of the xml server control to that of the XslTransform object. Now run the code and you will get the web page displayed according to the xslt file you have created.
|
|
||
|
|||
“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”
Copyright - © 2004 - 2019 - All Rights Reserved.