Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

can we generate a class using xsd.exe when there is a <simpleType> ?

Question posted by: shruthid (Newbie) on July 1st, 2008 10:06 AM
can we generate a class for the following xsd file using xsd.exe?? it does'nt contain a complex type..


<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema targetNamespace="http://www.sonatacentral.com/service/v20" xmlns:sc="http://www.sonatacentral.com/service/v20" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:simpleType name="ExpenseGroup">
<xs:annotation>
<xs:documentation>tscm_expense_group.expg_short_description</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:maxLength value="15" />
</xs:restriction>
</xs:simpleType>
</xs:schema>

when i try to generate a class file for this xsd using xsd.exe, it throws me the following error:

Warning: cannot generate classes because no top-level elements with complex type were found.

Please help.

Thanks,
Shruthi
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
jkmyoung's Avatar
jkmyoung
Moderator
765 Posts
July 2nd, 2008
06:50 PM
#2

Re: can we generate a class using xsd.exe when there is a <simpleType> ?
No, a proper schema needs at least one element; otherwise you're not referring to an xml document. Is there a particular reason you're trying to do this?

Reply
Reply
Not the answer you were looking for? Post your question . . .
182,255 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Top XML Forum Contributors