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 / July 2006

Tip: Looking for answers? Try searching our database.

Validate against XML doc already in memory

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MikeL - 28 Jul 2006 18:41 GMT
Hello.

I have an XMLDoc object that loaded XML using the LoadXML method.

I have a schema in a XmlSchemaCollection object.

I want to validate the XML document in the XMLDoc object. All the resources
that I've found use the XMLTextReader object, but I am not reading from
disk.

How do I do this?

Thanks in advance,

Mike
Martin Honnen - 28 Jul 2006 18:57 GMT
> I have an XMLDoc object that loaded XML using the LoadXML method.
>
[quoted text clipped - 3 lines]
> that I've found use the XMLTextReader object, but I am not reading from
> disk.

If you use .NET 2.0 then there is a method called Validate on the
XmlDocument instance.
XmlSchemaCollection sounds more like you are using .NET 1.x. Is that right?

Signature

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/

MikeL - 28 Jul 2006 19:28 GMT
Hi, Martin.

Yes, that's correct. I'm using .Net 1.x

Too bad there's no simple method. Any ideas?

>> I have an XMLDoc object that loaded XML using the LoadXML method.
>>
[quoted text clipped - 8 lines]
> XmlSchemaCollection sounds more like you are using .NET 1.x. Is that
> right?
Priya Lakshminarayanan - 28 Jul 2006 19:55 GMT
Even if you are creating the xml in-memory, you can still load the
XmlDocument using an XmlValidatingReader that loads the xml from a
StreamReader.
This will give you validation at load-time.

Thanks,
Priya

> Hi, Martin.
>
[quoted text clipped - 14 lines]
>> XmlSchemaCollection sounds more like you are using .NET 1.x. Is that
>> right?

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.