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