As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

XML into Excel

FeralFeral MEMETICHARIZARDinterior crocodile alligator ⇔ ǝɹʇɐǝɥʇ ǝᴉʌoɯ ʇǝloɹʌǝɥɔ ɐ ǝʌᴉɹp ᴉRegistered User regular
I have two different XML files that I'm trying to import into Excel 2016. As far as I can tell, they're structured mostly the same way. Here's a sanitized example of how they're structured.
<Report>

	<Family>
		<Surname>Doe</Surname>
		<Mother>Jane</Mother>
		<Father>John</Father>
		<Child>Timmy</Child>
		<Child>Julie</Child>
		<Child>Andy</Child>
	</Family>

	<Family>
		<Surname>Smith</Surname>
		<Mother>Steve</Mother>
		<Father>Sharon</Father>
		<Child>Madison</Child>
		<Child>Mason</Child>
	</Family>

	<Family>
		<Surname>Wilson</Surname>
		<Mother>Vanessa</Mother>
		<Father>Wade</Father>
		<Child>Logan</Child>
		<Child>Charles</Child>
		<Child>Scott</Child>
		<Child>Jean</Child>
		<Child>Peter</Child>
		<Child>Clark</Child>
		<Child>Jean-Luc</Child>
		<Child>Anakin</Child>
		<Child>Inara</Child>
	</Family>

</Report>

One of these XMLs imports exactly the way I want it to:

h027w1v0nf1l.png

The other one, however, does this. And I can't figure out why.

puaq3gdgf5dv.png

The only difference I can find is that the second one has a lot of namespaces declared, so it really looks more like this:
<Report>

	<Family xmlns="http://www.yourmother.com/bagofdicks/family.html">
		<Surname xmlns="http://www.yourmother.com/bagofdicks/surname.html">Doe</Surname>
		<Mother xmlns="http://www.yourmother.com/bagofdicks/mother.html">Jane</Mother>
		<Father xmlns="http://www.yourmother.com/bagofdicks/father.html">John</Father>
		<Child xmlns="http://www.yourmother.com/bagofdicks/child.html">Timmy</Child>
		<Child xmlns="http://www.yourmother.com/bagofdicks/child.html">Julie</Child>
		<Child xmlns="http://www.yourmother.com/bagofdicks/child.html">Andy</Child>
	</Family>

<!-- Excess snipped -->

</Report>

I've tried removing some of the xmlns declarations to see if it changes anything and it doesn't.

Can anybody explain this behavior?

every person who doesn't like an acquired taste always seems to think everyone who likes it is faking it. it should be an official fallacy.

the "no true scotch man" fallacy.

Posts

  • Options
    bowenbowen How you doin'? Registered User regular
    Something's up with that nesting, check for improperly closed tags and all that.

    It's adding extra rows instead of transposing the data.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    FeralFeral MEMETICHARIZARD interior crocodile alligator ⇔ ǝɹʇɐǝɥʇ ǝᴉʌoɯ ʇǝloɹʌǝɥɔ ɐ ǝʌᴉɹp ᴉRegistered User regular
    I gave up and used a different method to get the data I needed. Thanks, tho.

    every person who doesn't like an acquired taste always seems to think everyone who likes it is faking it. it should be an official fallacy.

    the "no true scotch man" fallacy.
Sign In or Register to comment.