strange behaviour in Excel 2003 when importing XML

M

Marius Bancila

I have noticed a strange behaviour in the import of XML files.

If I have this XML file:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<books>
<book>
<title>Ubik</title>
<author>Philip K. Dick</author>
</book>

<book>
<title>Dune</title>
<author>Frank Herber</author>
</book>
</books>
When I open this file in Excel, it creates a row with the element names,
title and author, like this.

title author
Ubik Philip K. Dick
Dune Frank Herber

When I click on title our author I get the combo box tha allows me to sort
the elements. That's exactly what I need. But...

If my XML file has only one element like this:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<books>
<book>
<title>Ubik</title>
<author>Philip K. Dick</author>
</book>
</books>

the file is not imported in the same way, the title and author entries are
missing, the sheet simply looks like this:

Ubik Philip K. Dick

I don't understand what the problem is. Can anyone suggest how to workaround
it so that it shows the title & author row all the time?

Thank you very much,
Marius Bancila
 
M

Marius Bancila

Doesn't anyone have an idea about a workaround, other than inserting a dummy
element?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top