tags:

views:

31

answers:

2

Hi, I have a bunch of XML files that have a flat hierarchy, but each contain a differing amount of (uniquely named) nodes. Example:

<?xml version="1.0" encoding="UTF-8"?>   
<SomeName>   
  <Node1> 
    DataA 
 </Node1>   
 <Node2> 
    DataB 
 </Node2>   
  <Node3> 
    DataC 
 </Node3>   
  <AnotherNode1> 
    DataD 
 </AnotherNode1> 
  <AnotherNode2> 
    DataE 
 </AnotherNode2> 
  <AnotherNode3> 
    DataF 
 </AnotherNode3> 
 <SingleNode> 
    DataG 
 </SingleNode> 
</SomeName>   

I need to import all these files into an excel table with each column bein associated to a specific node.

Example:

Node1      Node2     Node3     AnotherNode1    AnotherNode2     Anothernode3     SingleNode

DataA      DataB     DataC        DataD           DataE            DataF            DataG

Is there some way to batch import these files or convert them first? Thanks!

A: 

www.smooks.org will turn almost anything into almost anything else. You could even use XSLT to create a CSV file. how-do-i-write-an-xslt-to-transform-xml-to-csv

Chris Kaminski
I actually already tried converting the XMLs into CSVs (ven using the link you posted), but it doesn't help me, because the resulting CSV files only comma-seperate the data and don't give any information about the node names. This is a problem because my XML files have varying amount of nodes.Smooks looks insteresting but a bit too complicated for me right now.Do you know if I can create a master-table (with all node possibilites) in excel and then import the XMLs into that structure?Thanks!
Grinner
A: 

Why not use ActiveWorkbook.XmlImport in VBA?

Remou