Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to XML Map Repeating Rows?

9,070 views
Skip to first unread message

DaveLS

unread,
Nov 12, 2009, 3:16:01 PM11/12/09
to
I'm trying to map XML to a range of rows but, for some reason, Excel (2007)
is only mapping it to the first row of the range. I've created an XML file
and imported it. Then, I right-click on the root element and choose Map
Element. Excel asks "Where do you want to map the XML elements?" I click and
drag a range of contiguous cells and it updates the range in the little
dialog box. The range displayed include the full range of columns and rows so
I hit OK. But then Excel only shows the first row with the blue border. And
when I export it only exports the first row.

What am I doing wrong? I've done this before successfully with a slightly
different map and it was working fine. I can't figure out what I'm doing
wrong today.

David Salahi

DaveLS

unread,
Nov 12, 2009, 4:56:02 PM11/12/09
to
OK, I figured out the answer to my own question. The problem was that the
sample XML that I created to define the XML map had only a single XML node.
You have to have at least two XML nodes or "records" in order to map the node
as a repeating element.

Dave


Simon Motaung

unread,
Dec 18, 2009, 12:17:12 AM12/18/09
to

Hi Dave,

I have a similar problem and i've actually tried your solution above
to no avail. May I email you my spreadsheet and the sample XML i'm
using? I'll really appreciate your help. I'd actually now resorted to
mapping each row (1199 rows) in excel to each element in the xml and
this is a painful task. I'll really appreciate your assistance in this
regard.

Thanks in advance.
Simon

Shane

unread,
Sep 7, 2014, 11:42:36 PM9/7/14
to
Oh my goodness. Thank you for taking the time to answer your own question. I've been trying to figure this out for about four hours. Your solution worked fine for me. Life-saver, thanks!!

gtrs...@gmail.com

unread,
Feb 24, 2015, 2:57:42 AM2/24/15
to
I cant thank you enough for posting this. It solved a problem I've been trying to figure out for hours. Thank you

mitch...@gmail.com

unread,
Apr 7, 2015, 2:28:09 PM4/7/15
to
Thanks

marco....@gmail.com

unread,
May 25, 2015, 11:37:36 AM5/25/15
to
Thank you, thank you, thank you!

c...@throttlebob.com

unread,
Mar 1, 2016, 4:29:30 PM3/1/16
to
Thank you - That was driving me nuts

gp.c...@gmail.com

unread,
Apr 4, 2016, 12:05:10 PM4/4/16
to
Thank you for the solution.

mese...@gmail.com

unread,
Feb 2, 2017, 9:08:21 AM2/2/17
to
Hi Dave

Thanks I was having this exact issue... You are my saviour!

ME

ll...@esntl.co

unread,
May 18, 2018, 12:12:49 AM5/18/18
to
Thanks Dave! The post that keeps on giving!

Cheers, Lloyd

dcor...@gmail.com

unread,
Jun 13, 2018, 4:03:50 PM6/13/18
to
I had a similar problem but the XML structure was complex enough that some XML files had single records where other XML files had repeating elements, across hundreds of elements.

Here's how I overcame it:
I learned from here that you can dig into the workbook structure of an excel file and access the xml code of the XML map directly: https://stackoverflow.com/questions/8184707/excel-add-a-field-to-an-xml-map

I followed these instructions to convert an xlsx to zip, unzip, and access the xmlMaps.xml file: http://professor-excel.com/xml-zip-excel-file-structure/

And I used some insight from this thread to do some analysis of the xml file and I did a find / replace to change maxOccurs="1" to maxOccurs="unbounded" for those elements I needed to see as repeating elements rather than single record: https://answers.microsoft.com/en-us/msoffice/forum/msoffice_excel-mso_other/importing-multiple-xml-files-into-excel/25b77df2-d558-476c-967a-c3a0b94a8b1e

Maybe this will help others in the future :)
DC

dhham...@gmail.com

unread,
Feb 21, 2019, 2:27:16 PM2/21/19
to
dcor,

I have the same problem except for when I dig into my xmlMaps.xml file there are no cases of maxOccurs and only minOccurs. Do you have any idea how to map repeating elements if there's no maxOccurs="1" to change to "unbounded"?

maiph...@gmail.com

unread,
May 5, 2020, 4:47:28 AM5/5/20
to
Vào 03:16:01 UTC+7 Thứ Sáu, ngày 13 tháng 11 năm 2009, DaveLS đã viết:
Thank you

Manni Schneiderbauer

unread,
Feb 15, 2023, 6:09:18 AM2/15/23
to
In 2023 still a life- and timesaver. Thanks!
0 new messages