Solved

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

Posted on 2010-09-10
1
558 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now