ChrisHarrington wrote:
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
XmlValidatingRe ader to see if that made any difference but it did not. Any
suggestions? Thanks
XmlType sounds like you are using .NET 2.0, XmlValidatingRe ader not.
If you are using .NET 2.0 then make sure that processing inline schemas
is enabled when you load the document e.g.
XmlReaderSettin gs readerSettings = new XmlReaderSettin gs();
readerSettings. ValidationFlags |=
XmlSchemaValida tionFlags.Proce ssInlineSchema;
readerSettings. ValidationType = ValidationType. Schema;
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Loa d(XmlReader.Cre ate(@"file.xml" , readerSettings) );
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/