in this article i will show you how to implement an xsltransform wrapper to trace and profile xslt transformations at runtime in .net applications. the source code and supporting files can be downloaded from www.sys-con.com/dotnet/sourcec.cfm.
tests executed and results obtained to verify the execution and performance of xslt transformations during development and testing are often not fully representative of production use case scenarios encountered in a live environment. troubleshooting xslt transformations that performed well during the development and testing phases but later exhibit unexpected behavior in a production environment can be a daunting task.
random exceptions, access violations, generation of unexpected/ incorrect output, and inconsistent drops in query execution perfor- mance (prolonged high cpu usage or idle times) are examples of common problems that you can encounter when executing xslt transformations in production environments. such problems are most commonly caused by the design of the xslt style sheet(s) used to execute the transformations. these problems can be difficult to reproduce and troubleshoot when the source xml data is generated dynamically and varies by user, e.g., dynamically generated queries to retrieve source xml data from a sql server back end, or data retrieved dynamically from external web services.
in such situations the availability of the following diagnostic data can help significantly reduce the time to identify the cause of the problem in an xslt transformation and take the required corrective action:
2. the xslt style sheet used to execute the transformation 【程序编程相关:Enterprise Strategy 】1. the context source xml data 【推荐阅读:Generalized Enumerat】3. an xslt transformation trace/profiler log to the point of failure, manual termination, or completionthe context source xml data can be difficult to obtain in dynamic environments without source code modifications. the availability of this item combined with the style sheet (which is usually easily attainable, as style sheets are commonly loaded from the disk) will provide users the data they will need to recreate the problem on a development/test server.
an xslt transformation trace/profiler log will help execute a time- and resource-efficient post mortem analysis of the failed/problematic xslt transformation to determine the progress to the point of failure/manual termination/completion, isolate the cause of an observed problematic behavior, and take the required corrective action.
these items should be obtainable without having to resort to executing time-consuming troubleshooting steps that require the use of advanced debugging tools and/or the implementation of source code modifications. being able to obtain diagnostic data representative of a live use case in a timely manner will facilitate faster problem isolation and resolution.
in the .net framework, the xsltransform type in the system.xml.xsl namespace implements the api to execute xslt transfo... 下一页