Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 8th, 2006, 05:25 PM
ChrisHarrington
Guest
 
Posts: n/a
Default How to get XmlType of a node from in-line schema

I load an XmlDocument which has an inline schema. I want to use XmlType
property of XPathNavigator to get the type according to this inline schema.
But XmlType is null for all nodes. I tried loading the documenting from an
XmlValidatingReader to see if that made any difference but it did not. Any
suggestions? Thanks

Chris


  #2  
Old August 8th, 2006, 05:45 PM
Martin Honnen
Guest
 
Posts: n/a
Default Re: How to get XmlType of a node from in-line schema



ChrisHarrington wrote:
Quote:
I load an XmlDocument which has an inline schema. I want to use XmlType
property of XPathNavigator to get the type according to this inline schema.
But XmlType is null for all nodes. I tried loading the documenting from an
XmlValidatingReader to see if that made any difference but it did not. Any
suggestions? Thanks
XmlType sounds like you are using .NET 2.0, XmlValidatingReader not.

If you are using .NET 2.0 then make sure that processing inline schemas
is enabled when you load the document e.g.
XmlReaderSettings readerSettings = new XmlReaderSettings();
readerSettings.ValidationFlags |=
XmlSchemaValidationFlags.ProcessInlineSchema;
readerSettings.ValidationType = ValidationType.Schema;

XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(XmlReader.Create(@"file.xml", readerSettings));



--

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

Bookmarks

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