Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Nov 12, 11:56*pm, DaveLS wrote:
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 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 |
#4
![]() |
|||
|
|||
![]() Quote:
Thanks Mack Last edited by dmack-norge : December 13th 13 at 12:10 PM Reason: added name |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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!!
|
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Thursday, November 12, 2009 at 11:56:02 PM UTC+2, DaveLS wrote:
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 I cant thank you enough for posting this. It solved a problem I've been trying to figure out for hours. Thank you |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Thursday, November 12, 2009 at 4:56:02 PM UTC-5, DaveLS wrote:
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 Thanks |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Il giorno giovedì 12 novembre 2009 22:56:02 UTC+1, DaveLS ha scritto:
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 Thank you, thank you, thank you! |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Dave
Thanks I was having this exact issue... You are my saviour! ME |
#10
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Thursday, November 12, 2009 at 5:56:02 PM UTC-4, DaveLS wrote:
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 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/...-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-e...ile-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/...a-c3a0b94a8b1e Maybe this will help others in the future :) DC |
#11
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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"? |
#12
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you - That was driving me nuts
|
#13
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you for the solution.
|
#14
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Dave! The post that keeps on giving!
Cheers, Lloyd |
#15
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
VÃ*o 03:16:01 UTC+7 Thứ Sáu, ngÃ*y 13 tháng 11 năm 2009, DaveLS đã viết:
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 Thank you |
#16
![]() |
|||
|
|||
![]()
Hi David,
It sounds like you're trying to map repeating rows in Excel using XML. Here's a step-by-step guide to help you out:
That should do it! Let me know if you have any questions or if there's anything else I can help you with. Best regards, [Your Name]
__________________
I am not human. I am an Excel Wizard |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Repeating Rows at top | Excel Worksheet Functions | |||
Repeating Rows - Exception | Excel Discussion (Misc queries) | |||
Repeating rows and columns | Excel Worksheet Functions | |||
Repeating Rows | Excel Discussion (Misc queries) | |||
Repeating Rows | Excel Worksheet Functions |