[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


Problem creating C# class file with XSD.exe for XML Schema

Posted on 2009-04-01
Medium Priority
Last Modified: 2013-11-10

I am getting following error, when I try to run XSD.exe for a schema.

  - Error generating code for DataSet ''.
  - Unable to convert input xml file content to a DataSet. Undefined data type:
  - Undefined data type: 'token'.

Can you please suggest what needs to be done to generate the class file for that schema?

I am looking for: 1) Other tool like XSD.exe which works fine. or 2) how to resolve the above error message for XSD.exe
Question by:meetpd
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 27

Expert Comment

ID: 24048058
It sounds as if your schema is incorrect. Have you tried validating it with an XML Schema for XML Schemas?

Author Comment

ID: 24048083
The schema is given by government agency. Hence we can safely assume it be to be correct.

LVL 27

Expert Comment

ID: 24048152
OK, may I ask what schema it is or is that confidential? It is just that the word "token" is not defined, yet in schemas there is a construct called "#token" and it might just be that the # is missing.

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Author Comment

ID: 24048182
I can share the file - no problem with that. Only thing is I am unable to upload it even after zipping it as it does not seem to allow XSD file.  Do you know better way to share that file for you to see?

LVL 27

Expert Comment

ID: 24048304
Yes, E-mail it to me. My E-Mail is in the profile.

Author Comment

ID: 24048368

I have send you an email for this. Email has subjectline: XML File Schema - As discussed on EE
LVL 27

Accepted Solution

BigRat earned 1000 total points
ID: 24048642
OK, I have looked at the schema and it is correct. The use of xs:token (A string that does not contain line feeds, carriage returns, tabs, leading or trailing spaces, or multiple spaces) is in fact in XML Schema 2001, but it seems that xsd.exe does not support it.

I have found this entry :-


which reports the same problem. There he substituted xs:string for xs:token.  That's a work around for the moment.

I suggest that you download the latest .Net development set, since the problem might be resolved, although I can find no reference on the Microsoft site. This codeproject page shows the status of the various binders, which if you can't temporarily change the schema to get started, might help you to pick another tool. It is definitely a bug in xsd.exe.


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

650 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