Avatar of intergy-ee
intergy-eeFlag for Australia

asked on 

XSD Enumeration

Hi,

I have an enumeration specified for xsd schema, I want that enumeration be empty while passing frm xml. I tried with the follwing code but still I get data type mismatch error when its is empty. same this happens with date date type also. Can any one got sloluiton for this.
<xs:element name="ContFreq" nillable="true">
                            <xs:simpleType>
                              <xs:restriction base="xs:string">
                                <xs:maxLength value="1" />
                                <xs:enumeration value="W" />
                                <xs:enumeration value="F" />
                                <xs:enumeration value="E" />
                                <xs:enumeration value="M" />
                                <xs:enumeration value="Q" />
                                <xs:enumeration value="S" />
                                <xs:enumeration value="A" />
                              </xs:restriction>
                            </xs:simpleType>
                          </xs:element>

Web Languages and StandardsXML

Avatar of undefined
Last Comment
Gertone (Geert Bormans)
Avatar of TomLun
TomLun
Flag of Sweden image

There's a distinction between being nillable and having no content. Since your content model do not allow for empty contents you need to use
  <ContFreq xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
in your source document when passing empty contents.
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Web Languages and Standards
Web Languages and Standards

Web development can range from developing the simplest static single page of plain text to the most complex web-based internet applications, electronic businesses, and social network services using a wide variety of languages and standards, including the familiar HTML, JavaScript and jQuery, ASP and ASP.NET, PHP, ColdFusion, CSS, PHP, Flex and Flash, but also the implementation of a broad list of standards including XML, WSDL, SSDL, VoiceXML and many more.

40K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo