Solved

What is the correct way and tools to create xsd file for excel?

Posted on 2010-09-10
1
563 Views
Last Modified: 2012-05-10
I have a Sample.xml file
I used visual studio to create a xsd file as follow:
        Dim DS As New Data.DataSet
        DS.ReadXmlSchema("Sample.xml")
        'DT.TableName = "RobotLog"
        DS.WriteXmlSchema("sample.xsd")

I used Sample.xsd to map sample.xml in excel
and then modify the data in excel and then export to a new xml file

I have encountered this error: "cannot save or export xml data. the xml maps in this workbook are not exportable"


The sample:xsd is


<?xml version="1.0" standalone="yes"?>
<xs:schema id="Logs" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:element name="Logs" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Log">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="RobotID" type="xs:string" minOccurs="0" />
              <xs:element name="TaskID" type="xs:int" minOccurs="0" />
              <xs:element name="TaskLogicalID" type="xs:int" minOccurs="0" />
              <xs:element name="LogType" type="xs:int" minOccurs="0" />
              <xs:element name="TaskStartTime" type="xs:dateTime" minOccurs="0" />
              <xs:element name="TaskEndTime" type="xs:dateTime" minOccurs="0" />
              <xs:element name="Result" type="xs:string" minOccurs="0" />
              <xs:element name="Details" type="xs:string" minOccurs="0" />
              <xs:element name="Config" type="xs:string" minOccurs="0" />
              <xs:element name="Remark" type="xs:string" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>


If I don't want to edit the xsd in notepad.
What tools and the correct way can I use to create sample.xsd from sample.xml ??


Thanks!
part of Sample.xml

<?xml version="1.0"?>
<!--log file for Task ID: 77022-->
<Logs>
  <Log>
    <RobotID>ROBOT14</RobotID>
    <TaskID>16005</TaskID>
    <TaskLogicalID>16</TaskLogicalID>
    <LogType>6</LogType>
    <TaskStartTime>2010-09-06 23:43:47</TaskStartTime>
    <TaskEndTime>2010-09-06 23:44:02</TaskEndTime>
    <Result>Success</Result>
    <Details>-</Details>
    <Config>-</Config>
    <Remark>SPA#ST1D Group                                     2010-09-06 23:43:47 ~ 2010-09-06 23:44:02 Result: Successful</Remark>
  </Log>
</Logs>

Open in new window

0
Comment
Question by:Hoboly
1 Comment
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 33644441
I use Trang for autogeneration of schemata
- either in Oxygen IDE (www.oxygenxml.com) That is a very good XML IDE
- or command line (http://www.thaiopensource.com/relaxng/trang.html)
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question