XML
  Home arrow XML arrow Applying XSLT to XML Using ASP.NET
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML

Applying XSLT to XML Using ASP.NET
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 70
    2004-09-13

    Table of Contents:
  • Applying XSLT to XML Using ASP.NET
  • A Simple Example on XSLT
  • XSLT with ASP.NET
  • Query a Database and Transform through XSLT using ASP.NET
  • How to Transform More than One Row?

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Applying XSLT to XML Using ASP.NET


    (Page 1 of 5 )

    This article explains the basics of XSL to transform XML documents using simple examples. We will gradually focus on using ASP.NET to implement XSLT for any XML document and even to database queries. It introduces different ways of implementing XSL from browser’s perspective and server’s perspective. We will also discuss some tips to generate automated XML from database queries and then transform them to HTML using XSL transformations.

    Introduction to XSL

    Anyone who designs web pages using any tool/designer would certainly know about what CSS is. We use HTML in combination with CSS to design and present web pages in a more efficient manner. Basically a style sheet presents a sheet of styles, which would affect certain tag(s) in a web document. By modifying the underlying style sheets, sometimes the look and feel of entire website gets changed dramatically.

    As HTML is made up of standard pre-defined tags, we can simply design and apply style sheets for necessary tags using CSS, and browser can understand all those details very easily. But any XML document is generally designed using user-defined tags (elements) to which browser may not understand all those new tags (elements). Just like we use CSS to present HTML document in a well-formatted and understandable manner, we use XSL to present (transform) an XML document in any format we require.

    XSL stands for eXtensible Stylesheet Language. It is a language used to design and apply style sheets especially for XML documents. Originally the research started to provide style sheet technology to XML using XSL, but finally ended up with three more divisions of XSL. So, XSL now consists of three parts namely XSLT, XPath and XSL-FO. XSLT is a language for transforming XML documents (even today, several programmers call XSLT as XSL). XPath is a language to filter, search or sort information available in XML documents. XSL-FO is a language for formatting XML documents. In this article we mainly focus on XSLT, which stands for XSL Transformations.

    XSLT can also be used to transform an XML document to another XML document (it need not be only HTML document). Another beauty of XSLT is that it internally works/traverse using XPath language. We can even conclude that “The better we learn about XPath, the better XSLT we can design”. Although this article mainly focuses on XSL, I suggest you to go through the fundamentals of XPath language for a better understanding (but not necessary for this article).

    Another important issue is that “not all the browsers can understand XSLT technology”. Specifically old browsers like IE5, IE5.5, Netscape 4 etc, are not compatible with XSL or XSLT files to the full-fledged recommendations of W3C. They were developed on a working draft of W3C, which was not yet completed by the time of their releases. IE6 or above and NN6 or above are completely compatible with standard XSL(T) specifications recommended by W3C. But if we use any server side programming to implement XSLT (like ASP.NET), we can overcome the compatibility issues of any browser (as the transformation takes place at server without browser’s knowledge). This issue is deeply examined in the later part of this article.

    More XML Articles
    More By Jagadish Chaterjee


       · this article help intermediates to know about the power of xml using xls.can help...
       · Thank you very much, very helpful artical.
       · Excellent article for those seeking a straight forward way of switching from SQLXML...
     

    XML ARTICLES

    - More on Triggers and Styles and Control Temp...
    - Looking at Triggers with Styles and Control ...
    - A Closer Look at Styles and Control Templates
    - Styles and Control Templates
    - Properties and More in XAML
    - Elements and Attributes in XAML
    - XAML in a Nutshell
    - Importing XML Files into Access 2007
    - Using MSXML3.0 with VB 6.0
    - MSXML, concluded
    - MSXML, continued
    - MSXML Tutorial
    - Generating XML Schema Dynamically Using VB.N...
    - XSL Transformations using ASP.NET
    - Applying XSLT to XML Using ASP.NET





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek