Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default excel namespace import problem

I have experienced the following strange thing:
Mapping a XML file (with or without data) to an Workbook results in Excel
making the 'missing' xsd. I have exported this xsd to a file and saved it als
myxsd.xsd, by running the following VBAcode:
[reference to Microsoft XML, v5.0 added]

Dim xmap As XmlMap
Dim xml As New DOMDocument

For Each xmap In ActiveWorkbook.XmlMaps
xml.loadXML xmap.Schemas(1).xml
xml.Save "testing123.xsd"
next xmap

Now I wanted to map a new excel workbook to this newly created xsd. To my
surprise Excel was not able to do so, giving the error: "Cannot load the
specified XML of schema source" with the detail description:
"/schema/element[1]/ .... Undeclared XSD element:
'{http://www.w3.org/2001/XMLSchema}schema'."

Ok, let's look into the xsd in detail:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns0="http://www.w3.org/2001/XMLSchema"
<xsd:import namespace="http://www.w3.org/2001/XMLSchema"/
<xsd:element nillable="true" name="root"
<xsd:complexType
<xsd:sequence minOccurs="0"
<xsd:element minOccurs="0" ref="ns0:schema"/
[....]

there it is: the xsd:element with the *reference* to ns0:schema!! Why does
Excel not recognize this element all of a sudden? Is it because Excel cannot
map a schema with a imported namespace?? It's a mistery...

--
Martin Drenth
Microsoft Certified Professional
IT architect at Flores Automatisering
Amsterdam, the Netherlands
http://www.flores.nl
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem using obj.Namespace(sourceFileName) Namespace(DestinationFilename).Itemsand then opening the xls file which creates a Temp Folder inside Temp Yuvraj Excel Discussion (Misc queries) 3 May 3rd 09 11:59 AM
Excel does not recognize xsd:import namespace??? martinitram Excel Programming 0 June 23rd 06 03:56 PM
namespace.pickfolder Steve[_63_] Excel Programming 2 September 1st 05 12:39 PM
Smart Documents - XSD and Namespace Paul Hasell Excel Programming 7 August 31st 05 06:07 PM
Macro looking to Outlook for namespace. gobjob Excel Programming 1 July 26th 05 11:58 PM


All times are GMT +1. The time now is 08:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"