Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problem using obj.Namespace(sourceFileName) Namespace(DestinationFilename).Itemsand then opening the xls file which creates a Temp Folder inside Temp | Excel Discussion (Misc queries) | |||
Excel does not recognize xsd:import namespace??? | Excel Programming | |||
namespace.pickfolder | Excel Programming | |||
Smart Documents - XSD and Namespace | Excel Programming | |||
Macro looking to Outlook for namespace. | Excel Programming |