Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 28th, 2006, 06:35 PM
MikeL
Guest
 
Posts: n/a
Default Validate against XML doc already in memory

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


  #2  
Old July 28th, 2006, 06:55 PM
Martin Honnen
Guest
 
Posts: n/a
Default Re: Validate against XML doc already in memory



MikeL wrote:

Quote:
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.
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
http://JavaScript.FAQTs.com/
  #3  
Old July 28th, 2006, 07:25 PM
MikeL
Guest
 
Posts: n/a
Default Re: Validate against XML doc already in memory

Hi, Martin.

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

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

"Martin Honnen" <mahotrash@yahoo.dewrote in message
news:ubs5L9msGHA.4596@TK2MSFTNGP04.phx.gbl...
Quote:
>
>
MikeL wrote:
>
>
Quote:
>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.
>
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
http://JavaScript.FAQTs.com/

  #4  
Old July 28th, 2006, 07:55 PM
Priya Lakshminarayanan
Guest
 
Posts: n/a
Default Re: Validate against XML doc already in memory

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

"MikeL" <milop@slomins.comwrote in message
news:%23lUUiOnsGHA.4748@TK2MSFTNGP03.phx.gbl...
Quote:
Hi, Martin.
>
Yes, that's correct. I'm using .Net 1.x
>
Too bad there's no simple method. Any ideas?
>
"Martin Honnen" <mahotrash@yahoo.dewrote in message
news:ubs5L9msGHA.4596@TK2MSFTNGP04.phx.gbl...
Quote:
>>
>>
>MikeL wrote:
>>
>>
Quote:
>>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.
>>
>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
>http://JavaScript.FAQTs.com/
>
>

 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles