Create xml file based on xPath from Excel with VBA

Posted by user1626236 on Stack Overflow See other posts from Stack Overflow or by user1626236
Published on 2012-08-27T21:37:13Z Indexed on 2012/08/27 21:38 UTC
Read the original article Hit count: 117

Filed under:
|
|

I've found some items that seem to dance around what I'm looking to do. I'm not a full-fledged programmer, but have been creating my own macros in Excel. I'm trying to create one now that will help me create the structure of an XML file.

I want to go down the list of XPaths, and for each one create any parents in the path as needed as well as the child and its value. I'll be adding another aspect to filter it to the fields I want, but the part I'm struggling with is the logic to check if each parent node exists, create it if needed, then add the child and its value.

Bonus would be if the output file were formatted with each node on a new line, and more so if it child nodes were indented from parent, but just creating it is my primary concern. Any help would be much appreciated, this has to potential to save me a lot of time.

© Stack Overflow or respective owner

Related posts about Xml

Related posts about xpath