Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Xml transformation big slowdown
Message
De
06/05/2006 16:01:08
 
Information générale
Forum:
ASP.NET
Catégorie:
XML
Divers
Thread ID:
01119792
Message ID:
01119891
Vues:
15
>Most probably the problem is on the various XPath expressions and/or loops (for-each) existing into the XSL file. I have great interest for XSL performance issues, but I am not able to give you more specific tips in order to improve the performance of this specific transformation. Having said that, I would be very glad if you could send me a sample of the XML document you are using directly to my e-mail (fmvazque@terra.com.br).

I used another approach. This one is rocket speed compare to the previous one. I obtain a result in 3.5 seconds for 863 rows which contain about 80 fields each.
        ' Export a dataset into an Excel spreadsheet
        ' expO1 DataSet
        ' expC1 Full path of the file to save
        Public Function ExportToExcel(ByVal toDataSet As DataSet, ByVal tcFile As String) As Boolean
            Dim lcXsl As String
            Dim loFileStream As FileStream
            Dim loXslCompiledTransform As Xsl.XslCompiledTransform = New Xsl.XslCompiledTransform

            ' Save the dataset in a Xml file
            If Not oApp.CreateFile(oApp.DataSetToXml(toDataSet), oApp.cHttpFat + "\Temp\Data.xml") Then
                Return False
            End If

            ' Generate a Xsl string based on the dataset
            lcXsl = GetXsl()

            ' Save the Xsl file
            If Not oApp.CreateFile(lcXsl, tcFile + ".xsl") Then
                Return False
            End If

            ' Load the Xsl in memory
            loXslCompiledTransform.Load(tcFile + ".xsl")

            ' Load the target file in memory
            loFileStream = New FileStream(tcFile, FileMode.Create)

            ' Do the transformation
            loXslCompiledTransform.Transform(New XPath.XPathDocument(oApp.cHttpFat + "Temp\Data.xml"), Nothing, loFileStream)

            ' We can now remove the temporary files
            oApp.DeleteFile(oApp.cHttpFat + "\Temp\Data.xml")
            oApp.DeleteFile(tcFile + ".xsl")

            Return True
        End Function
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform