What is the quickest (as in least effort, not super performance) way to convert 112K rows in XML to a Excel view.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re using Excel 2007 and want to use XSLT, your best bet would probably be use the EXPath Zip Module features to modify an existing Excel .xslx file.
My preferred option, however, would be to use a small Excel VBA Macro.
I’ve included sample code below for a VBA procedure called ‘load’ – this sample uses the XML DOM, so all 112K rows of your XML will be first loaded into memory, but if performance isn’t an issue its simpler than the SAX alternative.
You would need to modify
xpathToExtractRowto suit your XML input structure. There is also an assumption that the immediate child nodes of the XML row element contain the cell data you wish to import as text nodes, if not, you will need to use aSelectNodecall to get the data you require.Private dom As DOMDocument60
Public Sub load()
End Sub
Sample Input XML: