View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Xml data import weirdness

XML stands for X Meta Language. Meta laguage has format information that is
contained in angle brackets <format. In a webbrowser you can see this format
by going to view Menu - Source. You can also save the XML file to your disk
and look at the file with notepad.

It is not unusal for one program to save data diffferently from another
program reading the same data. It may be better to copy the section of the
XML file you want using Edit - Copy and then pasting Text only inot excel.

"Donal McWeeney" wrote:

Hi,

When trying to export xml from a web url we have noticed some really weird
behaviour.

The xml is off the following format:

<Items
<Item
<Sample1</Sample1
<Sample2</Sample2
</Item
<Item
<Sample1</Sample1
<Sample2</Sample2
</Item

etc


However if you try and import it you get the first two rows as:

/Items
/Item/Sample1 /Item/Sample2




We stumbled across a workaround for the /Items problem by changing the Items
element definition to the following:

<Items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

The import then will just import the data - any ideas why adding this
namespace seemed to fix the problem?

Excel also appears to ignore any inline schema we specify in the import
xml - is it possible to specify an inline schema? The setting up a schema
map is not the most end user friendly approach for us to take.


However using the above workaround we have stumbled across another problem
when trying to import from a really really long url. Firstly the url is too
long to paste so you have to navigate to it using the "New Web Query"
browser. The xml is displayed in the "New Web Query" browser, but when you
select the data source the displayed in excel contains the /Items and
/Item/etc rows described above. Also when this problem happens the data is
not included in a table!

Any idea why this may be?

Thanks

Donal