all groups > dotnet xml > july 2006 >
You're in the

dotnet xml

group:

Validate against XML doc already in memory


Re: Validate against XML doc already in memory Priya Lakshminarayanan
7/28/2006 11:55:08 AM
dotnet xml: 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

[quoted text, click to view]

Validate against XML doc already in memory MikeL
7/28/2006 1:41:10 PM
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

Re: Validate against XML doc already in memory MikeL
7/28/2006 2:28:00 PM
Hi, Martin.

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

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

[quoted text, click to view]

Re: Validate against XML doc already in memory Martin Honnen
7/28/2006 7:57:26 PM


[quoted text, click to view]


[quoted text, click to view]

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?


--

Martin Honnen --- MVP XML
AddThis Social Bookmark Button