Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / October 2003

Tip: Looking for answers? Try searching our database.

Schema validation question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Leonid Shprekher - 09 Oct 2003 15:37 GMT
Question to the Schema pro:

If  nillable="False" is default for Schema element, why schema validation of
my XML doesn't fail if I don't provide any value for the tag?

Thanks,

Leonid.
Oleg Tkachenko - 09 Oct 2003 16:09 GMT
> Question to the Schema pro:
>
> If  nillable="False" is default for Schema element, why schema validation of
> my XML doesn't fail if I don't provide any value for the tag?

Apparently because empty value is valid value for your element.
It's only  xsi:nil="true" attribute who defines that element value is null,
actual value has no impact on nillable stuff (but it's constarained by
presence of xsi:nil attribute of course).
Signature

Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Leonid Shprekher - 09 Oct 2003 16:30 GMT
Ok,

So what is your suggestion, I have to validate XML on Null in some important
tags. I can parse XML and do validation myself, but why do we need Schema?

Looks like you are Russian?

Leonid

> > Question to the Schema pro:
> >
[quoted text clipped - 9 lines]
> http://www.tkachenko.com/blog
> Multiconn Technologies, Israel
Oleg Tkachenko - 09 Oct 2003 16:41 GMT
> So what is your suggestion, I have to validate XML on Null in some important
> tags. I can parse XML and do validation myself, but why do we need Schema?
The only way of using nillable schema stuff is to place xsi:nil attribute into
your instance XML. If input XML is out of your control and you need to
validate empty values instead, that's trivial - just define in schema the
element cannot have empty content, that's it, say
<xs:element name="foo">
    <xs:simpleType>
        <xs:restriction  base="xs:string">
            <xs:minLength value="1"/>
        </xs:restriction>
    </xs:simpleType>
</xs:element>

> Looks like you are Russian?
Not exactly :)
Signature

Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.