XML
  Home arrow XML arrow Page 3 - Designing Your Own Reporting Service: A We...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
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

Designing Your Own Reporting Service: A Web Service to Convert XML to HTML Using XSL
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 7
    2005-12-19

    Table of Contents:
  • Designing Your Own Reporting Service: A Web Service to Convert XML to HTML Using XSL
  • Developing the XML Web Service
  • Developing the XML Web Service continued
  • Defining the XSLT
  • Executing and testing the XML Web Service
  • Understanding the web service
  • Improvements to the solution

  • 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


    Designing Your Own Reporting Service: A Web Service to Convert XML to HTML Using XSL - Developing the XML Web Service continued


    (Page 3 of 7 )

    Now, let us proceed with the “GenerateHTMLString” method, which is usually called by “BuildHTMLString”.

    private string GenerateHTMLString(string sXMLSource)
                {
                      // Create the XslTransform.
                      XslTransform xslt = new XslTransform();
     
                      XmlUrlResolver resolver = new XmlUrlResolver();
                      resolver.Credentials =
    System.Net.CredentialCache.DefaultCredentials;
                     
                      // Load the stylesheet.
                      string sXSLLocation = GetXSLLocation();
                      xslt.Load( sXSLLocation );
                     
     
                      // Load the XML string.
                      XmlDataDocument xmlDoc = new XmlDataDocument();
                      xmlDoc.XmlResolver = resolver;
                      xmlDoc.LoadXml(sXMLSource);
     
                      // Create the Stream to place the output.
                      Stream stream = new MemoryStream();
     
                      // Transform the file.
                      xslt.Transform(xmlDoc, null, stream, resolver);
     
                      // Remember to Flush the Stream and set the position to
    0
                      stream.Flush();
                      stream.Position = 0;
     
                      // Create a StreamReader to Read the Stream and Return
    the String
                      System.IO.StreamReader sr = new System.IO.StreamReader
    (stream);
                      return sr.ReadToEnd();
                }

    And thus, our coding (development) part is successfully finished.  The next section helps you to build the solution and test it from within Visual Studio.NET IDE to your own satisfaction.

    More XML Articles
    More By Jagadish Chaterjee


       · Did you ever think of designing your own simple reporting service with technologies...
     

    XML ARTICLES

    - Datatypes and More in RELAX NG
    - Providing Options in RELAX NG
    - An Introduction to RELAX NG
    - Path, Predicates, and XQuery
    - Using Predicates with XQuery
    - Navigating Input Documents Using Paths
    - XML Basics
    - Introduction to XPath
    - Simple Web Syndication with RSS 2.0
    - Java UI Design with an IDE
    - UI Design with Java and XML Toolkits
    - Displaying ADO Retrieved Data with XML Islan...
    - Widget Walkthrough
    - Introduction to Widgets
    - The Why and How of XML Data Islands






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT