473,327 Members | 2,012 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,327 software developers and data experts.

XSL Transform

I have having a problem when transforming. It is taking an unusually long
time to transform. Any tips?

Dim xmlDoc As System.Xml.XmlDataDocument = New
System.Xml.XmlDataDocument(dsClaimProcessing_Selec tData)
Dim xslTran As System.Xml.Xsl.XslTransform = New System.Xml.Xsl.XslTransform
xslTran.Load("ClaimDSToXML.xslt")
Dim sClaimProcessingFormattedData As String
Dim NewMemoryStream As New System.IO.MemoryStream
'THIS LINE TAKES ABOUT 4min 30sec
xslTran.Transform(xmlDoc, Nothing, NewMemoryStream, Nothing)

NewMemoryStream.Position = 0
Dim trTextReader As New System.IO.StreamReader(NewMemoryStream)
sClaimProcessingFormattedData = trTextReader.ReadToEnd
--
Ken Simmons
MCSD.Net
Nov 20 '05 #1
6 1792
Hi Ken,

10MB of xml and 40K of complex xsl and 4m30s will be quick!!
I think it may be useful to know what your xml and xsl are? ;-)

Regards,
Fergus
Nov 20 '05 #2
The xml is 155k, but there is some logic in the xslt file. What I am doing
is taking a dataset and transforming it to the xml structure that I need it
to be. I just didn't know if there was something I was doing in the vb code
that was making it take longer than it should.

--
Ken Simmons
MCSD.Net
"Fergus Cooney" <fi******@tesco.net> wrote in message
news:Oh**************@TK2MSFTNGP09.phx.gbl...
Hi Ken,

10MB of xml and 40K of complex xsl and 4m30s will be quick!!
I think it may be useful to know what your xml and xsl are? ;-)

Regards,
Fergus

Nov 20 '05 #3
Hi Ken,

I'm still on the learning curve myself but the code looks pretty
straightforward.

One way to test it would be to put a reference in the xml file to the
stylesheet
and load it into Internet Explorer. See how long <it> takes to do the job. If
IE is
slow, too, then your xslt is the culprit. Are your XPaths as specific as
possible?
Do they do a lot of 'wild-card' searching, perhaps?

Could you post the xsl and a sample of the xml at all? I'd be interested
to see it.
If you'd like me to test it on my setup, feel free to email the lot direct to
me - xml,
xsl and project (cut-down a bit perhaps).

On the other hand, as I say, I'm still climbing the hill. There's an
excellent chap in
the xml newsgroup - microsoft.public.dotnet.xml.

Regards,
Fergus
Nov 20 '05 #4
Also, If I save the dataset to a file and manually apply the stylesheet it
only takes a few seconds. That it what is leading me to believe that it is
something with the code I submitted.

--
Ken Simmons
MCSD.Net
"Fergus Cooney" <fi******@tesco.net> wrote in message
news:Oh**************@TK2MSFTNGP09.phx.gbl...
Hi Ken,

10MB of xml and 40K of complex xsl and 4m30s will be quick!!
I think it may be useful to know what your xml and xsl are? ;-)

Regards,
Fergus

Nov 20 '05 #5
I replaced this line....
Dim xmlDoc As System.Xml.XmlDataDocument = New
System.Xml.XmlDataDocument(dsClaimProcessing_Selec tData)
with

Dim xmlDoc As New Xml.XmlDocument
xmlDoc.LoadXml(dsClaimProcessing_SelectData.GetXml )

and it went from 4 mins to 1 second
--
Ken Simmons
MCSD.Net
"Ken Simmons" <ke**@helathware.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I have having a problem when transforming. It is taking an unusually long
time to transform. Any tips?

Dim xmlDoc As System.Xml.XmlDataDocument = New
System.Xml.XmlDataDocument(dsClaimProcessing_Selec tData)
Dim xslTran As System.Xml.Xsl.XslTransform = New System.Xml.Xsl.XslTransform xslTran.Load("ClaimDSToXML.xslt")
Dim sClaimProcessingFormattedData As String
Dim NewMemoryStream As New System.IO.MemoryStream
'THIS LINE TAKES ABOUT 4min 30sec
xslTran.Transform(xmlDoc, Nothing, NewMemoryStream, Nothing)

NewMemoryStream.Position = 0
Dim trTextReader As New System.IO.StreamReader(NewMemoryStream)
sClaimProcessingFormattedData = trTextReader.ReadToEnd
--
Ken Simmons
MCSD.Net

Nov 20 '05 #6
Hi Ken,

Hot Dang!! :-D

Regards,
Fergus

Translation.
I'll be wary of XmlDataDocument. Thanks. :-)
Nov 20 '05 #7

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

Similar topics

5
by: Alex Vinokur | last post by:
Functor-parameters in the for_each() and transform() algorithms are passed by value. Might it make sense to have also algorithms for_each2() and transform2() which pass Functor-parameters by...
0
by: Xiaolei Li | last post by:
first off, i'm a total newbie at this stuff so excuse any wrong usage of terminology or whatever else. i have a XSL to transform a Document such that all "text" nodes will have a "SPAN" inserted...
2
by: John Lehmann | last post by:
I have an interesting problem. I am performing an XSL transform using the System.Xml.Xsl.Transform class. I have a database that contains the XSL style sheet string. And it seems to work pretty...
9
by: Patrick Guio | last post by:
Dear all, I am trying to use the std::transform algorithm to to the following vector< vector<char> >::iterator ik = keys.begin(); // key list iterator vector< vector<char> >::iterator is = ik;...
6
by: Stephen Cook | last post by:
Having worked through the problems around enabling the document function using an XmlUrlResolver I started work on building a useful class to hide the intricacies. Trying to generalise the process...
3
by: Jason S | last post by:
Hello Group, I am just about tearing my hair out with this one and thought someone may have some insight. I have a transform that wasn't working so I grabbed the nearest debugger (xselerator)...
4
by: schneider | last post by:
Anyone know if there is a way to dynamicly create a Xslt template/s and use them as an xml transform with-out use files for the Xslt? All the methods I see use files. I want to create a Xslt...
1
by: Mike Hofer | last post by:
I've got two statements in my code that are both generating weird, weird, weird messages: The first one was, Dim document As System.Xml.XmlDocument Dim navigator As...
4
by: Dean Card | last post by:
Okay, so here is the situation. I have need to do some on-the-fly image creation. I have everything working great except for the last part of it, applying a perspective type transform to the...
6
by: Vijai Kalyan | last post by:
Hello, I am trying to use std::transform to take in a collection of strings, transform them and insert the result into an output container. So, I wrote something like this: std::wstring...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.