Home | Business News | Browse by Publication | X | XML Journal

Troubleshooting .NET applications: sample scenarios illustrating the use of XSLT tracing, Part 2.

Publication: XML Journal
Publication Date: 01-MAR-04
Format: Online - approximately 3467 words
Delivery: Immediate Online Access

Article Excerpt
Instrumenting and tracing XSLT transformations by treating XSLT as a regular programming language can provide very useful diagnostic data to help analyze and troubleshoot problems.

In this article. I will walk you through sample scenarios to illustrate the use of the sample XSLT tracing implementation described in Part 1 of the series [XML-J, Vol. 5, issue 2]. The source code and supporting files can be downloaded from www.sys-con.com/xml/source.cfm.

Sample Use Case I: Transforming Dynamically Generated XML

The scenario described in this section will use the sample XSLT tracing implementation to profile and identify performance bottlenecks in an XSLT transformation executed by applying a style sheet to XML data generated dynamically by querying a SQL Server 2000 database. The SQL Server 2000 Northwind sample database will be used in this illustration. You can read this section and walk through the Transforming Static XML use case described in the next section if you do not have access to a SQL Server 2000 installation with the Northwind sample database. The functional base and steps to configure/use the XSLT tracing feature are common to both sample scenarios.

The DynamicClient.cs file in the TracingClient project contains the client Code that will be used in this scenario. Open this file and study the code and inline comments in the Main method. The scenario is very straightforward. ADO.NET code is used to fill a DataSet with data horn the Orders and Order Details tables for a user specified date range. The XML representation of the data is then extracted front the DataSet and transformed to HTML by applying a style sheet (OrderDetailsData.xsl). The style sheet is nothing fancy (kept simple to focus on the tracing functionality) and the generated HTML displays the Order data in a simple HTML table. Also note that initially tire transformation is executed using a System.Xml.Xsl.Xsl.Transform object.

Change the ADO.NET connection string in the code to point to your instance of SQI. Server (you must have the Northwind sample database) and build the solution. Open the Visual Studio .NET 2003 command prompt and navigate to the TracingClient executable folder (C:\TracingDemo\TacingClient\bin\debug). The Orders and Order Details tables contain data lot dates (Order date) ranging from 7/4/1996 to 5/6/1998.

Issue the following command to retrieve and transform data from the year 1996. Note die timing information reported for the phases that load the style sheet and execute tire transformation. You will see that the actual transformation (note the time before and after the transform) executes in [less than or equal to] 1 second. You can open and open the HTML generated by the transformation (output.html in the same folder) in IE to see how the data is tabulated:

TracingClient 7/4/1996 12/31/1996

Now let's reexecute the process by increasing tire date ranges to the following periods and observe die transformation execution times (the time before and after the transform):

1. 7/4/1996-12/31/1997

2. 7/4/1996-5/6/1998

Notice that the transformation took about 4-5 seconds for the first date range and about 8-10 seconds for the second. This clearly indicates that file style sheet is not scaling well as the size of the input XML...

Read the FULL article now - Try Goliath Business News - FREE!   
You can view this article PLUS...

  • Over 5 million business articles
  • Hundreds of the most trusted magazines, newswires, and journals (see list)
  • Premium business information that is timely and relevant
  • Unlimited Access

Now for a Limited Time, try Goliath Business News - Free for 3 Days!
Tell Me More   Terms and Conditions

Get Goliath Business News for 1 year - Just $99 (Save 65%)
Tell Me More   Terms and Conditions

Already a subscriber? Log in to view full article



More articles from XML Journal
DTD and XML Schema structures: conversion methods for J2EE and XML dev..., March 01, 2004
Application integration: addressing the issues: one-stop shopping is n..., March 01, 2004
Leveraging XML knowledge to design, develop, and deploy speech applica..., March 01, 2004
XML for client-side computing.(Industry Insight), March 01, 2004
XML-Journal/Web Services Journal Readers' Choice Awards: and the winne..., March 01, 2004

Looking for additional articles?
Search our database of over 3 million articles.

Looking for more in-depth information on this industry?
Search our complete database of Industry & Market reports by text, subject, publication name or publication date.

About Goliath
Whether you're looking for sales prospects, competitive information, company analysis or best practices in managing your organization, Goliath can help you meet your business needs.

Our extensive business information databases empower business professionals with both the breadth and depth of credible, authoritative information they need to support their business goals. Whether it be strategic planning, sales prospecting, company research or defining management best practices - Goliath is your leading source for accurate information.