Hi all
This is my first real post after i joined this forum 2 years ago. i apologies in advance.
I'm having some trouble creating xml files using this function.
in this loop:
acExportQuery= because i use a query
"Data_Out" = The Query Name
"C:\MyData" = The path where i save the xml file
FileNameOut= The name of the xml i want to save
"Transform3.xsl"=the name of the xsl because i need to transform the file
I have a table with 20.000 rows and they refer to 6500 types.
In the loop i create an xml for any of those types
The trouble is that this takes 20minutes to create all the files. Is it possible to find a faster way or this is the best i can get?
Thank you
This is my first real post after i joined this forum 2 years ago. i apologies in advance.
I'm having some trouble creating xml files using this function.
Code:
Public Sub XMLHandle(TypeExp As AcExportXMLObjectType, xmlOut As String, Path As String, NomeFile As String, ConvertingXSL As String)
Dim PathAndFile As String
PathAndFile = Path & NomeFile & ".xml"
' RAW XML EXPORT
If Dir(PathAndFile) <> "" Then Kill PathAndFile
Application.ExportXML TypeExp, xmlOut, PathAndFile
' TRANSFORM RAW XML (full XSLT processor)
Dim xmlDoc As Object, xslDoc As Object, newDoc As Object
Set xmlDoc = CreateObject("MSXML2.DOMDocument")
Set xslDoc = CreateObject("MSXML2.DOMDocument")
Set newDoc = CreateObject("MSXML2.DOMDocument")
' LOAD XML AND XSL FILES
xmlDoc.Load PathAndFile
xmlDoc.async = False
xslDoc.Load CurrentProject.Path & "\xml\" & ConvertingXSL
xslDoc.async = False
' TRANSFORM SOURCE TO FINAL
xmlDoc.transformNodeToObject xslDoc, newDoc
newDoc.Save PathAndFile
Set newDoc = Nothing
Set xslDoc = Nothing
Set xmlDoc = Nothing
End Sub
in this loop:
Code:
Do While rs.EOF = False
CurrentDb.QueryDefs("Data_Out").SQL= (...)
' here i update the sql of the query i export using the recordsets values
'in the where clause
FileNameOut=DFirst("NameDataOut", "Tmp_DataOut", "DataName = """ & CStr(rs("DataName")) & """")
XMLHandle acExportQuery, "Data_Out", "C:\MyData\", FileNameOut, "Transform3.xsl"
rs.MoveNext
Loop
acExportQuery= because i use a query
"Data_Out" = The Query Name
"C:\MyData" = The path where i save the xml file
FileNameOut= The name of the xml i want to save
"Transform3.xsl"=the name of the xsl because i need to transform the file
I have a table with 20.000 rows and they refer to 6500 types.
In the loop i create an xml for any of those types
The trouble is that this takes 20minutes to create all the files. Is it possible to find a faster way or this is the best i can get?
Thank you