> I have an XmlDocument loaded from an xml file. I have also an xsd schema file
> associated with it so that it will be in the XmlSchemaSet.
> How do I get the data type for the value of an XmlElement and XmlAttribute
> as described in the schema while I am accessing the nodes (attributes and
> element) in the XmlDocument?

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Is there any support in .Net to get the value (for both attribute and
element) in its defined types?
The value for XmlAttribute alway gives a string for example. If it is
defined as an interger in xsd, I would like to get it as an interger. Or I
have to write my code to convert it for every types from string.
> > I have an XmlDocument loaded from an xml file. I have also an xsd schema file
> > associated with it so that it will be in the XmlSchemaSet.
[quoted text clipped - 5 lines]
> <http://msdn2.microsoft.com/en-us/library/system.xml.xmlelement.schemainfo.aspx>
> <http://msdn2.microsoft.com/en-us/library/system.xml.schema.ixmlschemainfo.aspx>
Priya Lakshminarayanan - 18 Jul 2006 18:05 GMT
If you use an XPathNavigator over the XmlDocument, then you can get typed
values (typed according to the schema) using the following properties on the
navigator:
TypedValue Property
ValueAsBoolean Property
ValueAsDateTime Property
ValueAsDouble Property
ValueAsInt Property
ValueAsLong Property
Thanks,
Priya
> Is there any support in .Net to get the value (for both attribute and
> element) in its defined types?
[quoted text clipped - 14 lines]
>> <http://msdn2.microsoft.com/en-us/library/system.xml.xmlelement.schemainfo.aspx>
>> <http://msdn2.microsoft.com/en-us/library/system.xml.schema.ixmlschemainfo.aspx>