473,399 Members | 2,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Very Slow XSLTransform with XPathDocument

Framework 1.1 SP1.

Page.xml is about 1.5mg. m_oXSLTransform.Transform takes about 2 minutes.

When Page.xml is trimmed down to a smaller doc, it takes about 2 seconds.

Same code ran in about 4 seconds under asp.

not using <xsl:key>.

XslTransform m_oXSLTransform = new XslTransform();
m_oXSLTransform.Load("\default.xsl");
XPathDocument m_oXMLDocument = new XPathDocument("Page.xml");
XsltArgumentList xslArg = new XsltArgumentList();
m_oXSLTransform.Transform(m_oXMLDocument,xslArg,
context.Response.OutputStream);
Nov 18 '05 #1
4 1890
As an xml doc is expanded into memory ( from the text string or file) it can
become enormous, so if it is already 1.5 mb it could be as big as 6mb in
memory (i think x4 is a rule of thumb)

what you may have to do is look at using one of the other objects to process
your doc e.g. sax (is this called xmlreader in .net? i forget) but basically
this processes the xml doc as a long stream, throwing out all that it has
processed up to a given point, it just raises a bunch of events for each
thing it finds

or

get a big fast box

"Sean Hoffman" wrote:
Framework 1.1 SP1.

Page.xml is about 1.5mg. m_oXSLTransform.Transform takes about 2 minutes.

When Page.xml is trimmed down to a smaller doc, it takes about 2 seconds.

Same code ran in about 4 seconds under asp.

not using <xsl:key>.

XslTransform m_oXSLTransform = new XslTransform();
m_oXSLTransform.Load("\default.xsl");
XPathDocument m_oXMLDocument = new XPathDocument("Page.xml");
XsltArgumentList xslArg = new XsltArgumentList();
m_oXSLTransform.Transform(m_oXMLDocument,xslArg,
context.Response.OutputStream);

Nov 18 '05 #2
Something like this?:
XmlReader m_oXMReader = new XmlTextReader("Page.xml");
XslTransform m_oXSLTransform = new XslTransform();
m_oXSLTransform.Load("\default.xsl");
XPathDocument m_oXMLDocument = new XPathDocument(m_oXMReader);
XsltArgumentList xslArg = new XsltArgumentList();
m_oXSLTransform.Transform(m_oXMLDocument ,xslArg,
context.Response.OutputStream);

MACHINE IS ALREADY BIG AND FAST! :-)
Nov 18 '05 #3

hmmm not sure

DOM (aka xml document, xml data document)
this gives you a random access object that you can fully traverse
fast but 'expensive'

SAX (aka ? )
gives a foward only stream of xml which fires off events
(i only ever played around with this a bit in msxml)
e.g. series of events such as
elementfound,attribute found,attribute found, end of element found

you then needed to (in msxml at least)
implement an interface for each of these events that could be fired,
which in my example ended up as a big event handler with a massive case
statement

i'm not sure this helps you

i'm not even sure why you are trying to process such a huge xml doc in this
manner

why are you trying to do it out of interest?

"Sean Hoffman" wrote:
Something like this?:
XmlReader m_oXMReader = new XmlTextReader("Page.xml");
XslTransform m_oXSLTransform = new XslTransform();
m_oXSLTransform.Load("\default.xsl");
XPathDocument m_oXMLDocument = new XPathDocument(m_oXMReader);
XsltArgumentList xslArg = new XsltArgumentList();
m_oXSLTransform.Transform(m_oXMLDocument ,xslArg,
context.Response.OutputStream);

MACHINE IS ALREADY BIG AND FAST! :-)

Nov 18 '05 #4
web site is based on xml files stored in file a system with an xml <sitemap>
that stores the structure. The sitemap is very large and needed for the
presentation layer(xsl).

a future goal is to cut the page.xml down to only what the current xsl
demands, but for now it takes the whole sitemap. works fine in asp. :-)

thx.

"adolf garlic" wrote:

hmmm not sure

DOM (aka xml document, xml data document)
this gives you a random access object that you can fully traverse
fast but 'expensive'

SAX (aka ? )
gives a foward only stream of xml which fires off events
(i only ever played around with this a bit in msxml)
e.g. series of events such as
elementfound,attribute found,attribute found, end of element found

you then needed to (in msxml at least)
implement an interface for each of these events that could be fired,
which in my example ended up as a big event handler with a massive case
statement

i'm not sure this helps you

i'm not even sure why you are trying to process such a huge xml doc in this
manner

why are you trying to do it out of interest?

"Sean Hoffman" wrote:
Something like this?:
XmlReader m_oXMReader = new XmlTextReader("Page.xml");
XslTransform m_oXSLTransform = new XslTransform();
m_oXSLTransform.Load("\default.xsl");
XPathDocument m_oXMLDocument = new XPathDocument(m_oXMReader);
XsltArgumentList xslArg = new XsltArgumentList();
m_oXSLTransform.Transform(m_oXMLDocument ,xslArg,
context.Response.OutputStream);

MACHINE IS ALREADY BIG AND FAST! :-)

Nov 18 '05 #5

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

Similar topics

2
by: Anthony Bouch | last post by:
Can anyone tell me why I receive the following compiler warning after having recently upgraded to VS.Net 2003 and .Net 1.1? Warning CS0618: 'System.Xml.Xsl(System.Xml.XPath.IXPathNavigable,...
2
by: Graham Pengelly | last post by:
Hi I am trying to transform on System.Xml.XmlDocument into another using XslTransform without writing the object out to a file. I am guessing it should work something like this... public...
4
by: David S. Alexander | last post by:
I am trying to transform XML to XML using an XSLT in C#, but the root node of my XML is not being matched by the XSLT if it has an xmlns attribute. Am I handling my namespaces incorrectly? My C#...
0
by: MedIt | last post by:
Hi all, Help needed in the xsl transformation in c# while passing with arguments. I am trying to transform an xml programtically (c#), while passing with two parameters using the XsltArgumentList...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.