473,698 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XSLT Optimization


Hopefully, someone could point me in the right direction. I have web
services that takes a DataSet object and Transforms it into a
pre-defined XSD (outside of my organization's control). I have
successfully done everything, now I am at a point where I want to
verify that my XSLT logic is optimized. Since I am new to XSLT coding
logic, I want to make sure that my transformation from DataSet to new
XML format is optimal.

Basically, I want to find out any resources (website, books, etc.) that
you would highly recommend. There are alot of books out there, but I
wanted to "cut through the chase" and get your input.

Also, here is my implementation of the XMLTransform, if you see
anything that I could do to optimize the Transformation, please tell
me...

XmlDataDocument doc = new XmlDataDocument (<DataSet Object>);
XPathNavigator nav = doc.CreateNavig ator();
XmlDataDocument oDoc2 = new XmlDataDocument ();
XslTransform transForm = new XslTransform();
transForm.Load( Server.MapPath( xsltFilePath));
MemoryStream oMem = new MemoryStream();
try
{
doc.PreserveWhi tespace = false;
xsl.Transform(n av,null,oMem,nu ll);
oMem.Flush();
oMem.Position = 0;
oDoc2.PreserveW hitespace = false;
oDoc2.Load(oMem );
return oDoc2;
}
catch(Exception )
{<exception logic>}
finally{<clean up>}

Thanks for your time!
--
rviray
------------------------------------------------------------------------
rviray's Profile: http://www.msusenet.com/member.php?userid=4211
View this thread: http://www.msusenet.com/t-1871129064

Nov 12 '05 #1
2 2649
rviray wrote:
Basically, I want to find out any resources (website, books, etc.) that
you would highly recommend. There are alot of books out there, but I
wanted to "cut through the chase" and get your input.
Take a look here
http://msdn.microsoft.com/library/de...NetChapt09.asp
XmlDataDocument doc = new XmlDataDocument (<DataSet Object>);
XmlDataDocument is the slowest XML store for XSLT. If you need the
fastest one - use XPathDocument. Then you would need to copy all your
data though, so go measure first.
XPathNavigator nav = doc.CreateNavig ator();
XmlDataDocument oDoc2 = new XmlDataDocument ();
XslTransform transForm = new XslTransform();
transForm.Load( Server.MapPath( xsltFilePath));
MemoryStream oMem = new MemoryStream();
try
{
doc.PreserveWhi tespace = false;
xsl.Transform(n av,null,oMem,nu ll);
oMem.Flush();
oMem.Position = 0;
oDoc2.PreserveW hitespace = false;
oDoc2.Load(oMem );


This is wrong, don't buffer output, stream it:

oDoc2.Load(xsl. Transform(nav,( XsltArgumentLis t)null,(XmlReso lver)null));

--
Oleg Tkachenko [XML MVP, MCAD]
http://www.XmlLab.Net | http://www.XLinq.Net | http://blog.tkachenko.com
Nov 12 '05 #2
Hi rviray,

For XSLT optimization, check out the Stylus Studio XSLT Profiler:
http://www.stylusstudio.com/xslt_profiler.html

You can create a detailed node-by-node performance analysis of your
XSLT stylesheet to help locate and eliminate bottlenecks. Here's a
sample XSLT profiling report.
http://www.stylusstudio.com/examples...sltprofile.htm

It supports both MSXML 3/0/4.0 and Microsoft System.XML, so you can
even benchmark your XSLT against different XSLT processors. You can
download a free trial of Stylus Studio here:
http://www.stylusstudio.com/xml_download.html - Hope that helps.

Sincerely,
The Stylus Studio Team
http://www.stylusstudio.com

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3903
by: ted | last post by:
Was wondering if XSLT alone is appropriate for the following situation. From XML, I'm creating a small website (around 50 pages) with pages that link to each other through a nav menu and a "crumb-trail" of links. I'm transforming the XML with XSLT through Saxon. The nav menu and "crumb-trail" show the user where they are within the site and is made by reflecting the XML tree structure. My problem now is that when I want to generate...
1
3601
by: Mohit | last post by:
Hi Friends I have to call 1 of the 2 child XSLT files from the Main XSLT file based on some criteria. I want one child XSLT file will be executed by version 1 of XSLT processor and the other by version 2 of XSLT processor based on some condition. Q) How and where shall I write logic or import desirable XSLT on the Fly ? Q) When we call AAA.XSLT then it will be processed by XSLT Processor 1
3
2207
by: RC | last post by:
Sorry Dudes, I couldn't find an appropriate group to post about XML/XSLT issues. I can only post to these close groups. In most of programming languages are VERY easy to do: int i = 0; i = 3; i = i + 1;
3
2006
by: thomas.porschberg | last post by:
Hi, I want to read records from a database and export it in an arbitrary format. My idea was to feed a class with a String array fetched from the database and let this class fire SAX events as processor input. The basic class hierarchy is:
12
2911
by: das | last post by:
Hello all, I am using .NET XSLT to transform an XML into another XML file. All this is fine with small files, but when tested with big files (30MB) it is taking between 1hr-2hrs to just transform the file. Here is the code snippet: XPathDocument xdoc = new XPathDocument(fs); XPathNavigator nav = xdoc.CreateNavigator(); xslt.Transform(nav, null, strWriter, null);
8
3452
by: Lawrence | last post by:
Hi Is there any way of using variables in XSLT? I have been using <xsl:param name="showDetails"/and want to be able to set it to say 1 or 0 dependent on certain XSL:if statements throughout...is this possible? Kind Regards Lawrence
2
3221
by: killy971 | last post by:
I have been testing different libraries to process XSL transformations on large XML files. The fact is that I read a document from Intel, stating their library (XSLT accelerator) was more twice faster than Apache Xalan, and was designed to perform well on large XML files. - http://isdlibrary.intel-dispatch.com/isd/10/wp_XSLT.PDF - http://www.intel.com/cd/software/products/asmo-na/eng/366637.htm Please note that their benchmark was only...
12
2376
by: Stu | last post by:
Being a newbie with XSLT transformation code please excuse my neivte. In addition, I am not sure what I want to do can be done with xslt so I apologize up front for asking anything stupid I have a shell script that needs to get values from an XML file. What I want to do is transform the XML into something more KSH friendly so it can be easy to parsed in my KSH script. I would like to go through an entire XML document and for every...
20
2340
by: Ravikiran | last post by:
Hi Friends, I wanted know about whatt is ment by zero optimization and sign optimization and its differences.... Thank you...
0
8678
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9166
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4621
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.