Using XML and XSLT in ASP.Net page

XSLT 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.




_______________________________________________

FREE Subscription

Subscribe to our mailing list and receive new articles
through email. Keep yourself updated with latest
developments in the industry.

Name:
Email:

Note : We never rent, trade, or sell my email lists to
anyone. We assure that your privacy is respected
and protected.

_______________________________________







 

 

FREE Subscription

Stay Current With the Latest Technology Developments Realted to XML. Signup for Our Newsletter and Receive New Articles Through Email.

Name:

Email:

Note : We never rent, trade, or sell our email lists to anyone. We assure that your privacy is respected and protected.

 

 

Add to My Yahoo!

Visit XML Training Material Guide Homepage

 

 

Copyright - © 2004 - 2017 - All Rights Reserved.