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 / December 2003

Tip: Looking for answers? Try searching our database.

Validating XML file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Uwe Kuhne - 27 Dec 2003 20:27 GMT
I receive a XML file from a customer and want to use a schema for validating
the XML file. What I don't know how to do is, that I want to continue
processing this XML - file no matter if there is an error or not.

e.g. I have an element  <Code> which can contain values 1 to 9.

If something else is delivered within the XML file, I want to replace this
wrong value with the default 1.

Is this possible within  the schema definition, or do I have to treat this
in my program.

Thanks
Uwe
Oleg Tkachenko - 28 Dec 2003 08:06 GMT
> I receive a XML file from a customer and want to use a schema for validating
> the XML file. What I don't know how to do is, that I want to continue
[quoted text clipped - 7 lines]
> Is this possible within  the schema definition, or do I have to treat this
> in my program.

Validation against schema can tell you whether XML is valid or not.
Basing on that you can "fix" your XML in your code.

Signature

Oleg Tkachenko
XML Insider
http://www.tkachenko.com/blog

Uwe Kuhne - 28 Dec 2003 14:02 GMT
My hope was that this is possible. I would have prefered to have everything
inside the schema file, to see exactly which values are possible and what
happens if a value is outside a defined range.
For a user of this schema it's not possible to guess what happens inside my
program, if some wrong value is delivered.
But nevertheless thanks for your reply, it prevents me from a time consuming
search on the web.

Cheers Uwe

> > I receive a XML file from a customer and want to use a schema for validating
> > the XML file. What I don't know how to do is, that I want to continue
[quoted text clipped - 10 lines]
> Validation against schema can tell you whether XML is valid or not.
> Basing on that you can "fix" your XML in your code.
Kevin Yu [MSFT] - 30 Dec 2003 06:59 GMT
Hi Uwe,

Please try to take a look at the DataType Facets. The maxInclusive and
minInclusive property may meet your needs.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/htm/
xsd_ref_9rar.asp

Kevin Yu
Signature

=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


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.