all groups > dotnet xml > march 2005 >
You're in the

dotnet xml

group:

Access XmlSchema properties?



Access XmlSchema properties? Chris
3/31/2005 9:01:02 AM
dotnet xml: I'd like to be able to access the elements in an XSD/XmlSchema object to
determine things like the datatype. Can this be done without explicitly
running validation on a document? Can I programatically access the elements
via an XmlSchema object to determine datatype (or other properties)?

The motivation behind this is that I'm constructing an XML document node by
node and as the values come in, I'd like to check their data type before they
are added and raise an exception at that point as opposed to after the node
Re: Access XmlSchema properties? Chris
3/31/2005 11:17:04 AM
And I also just realized, since the XSD file is valid XML, I could just load
it as an XML file (not XmlSchema) and access the elements via XPath. Doh.

One of those methods will get me where I want. Thank you.

Chris

[quoted text, click to view]
Re: Access XmlSchema properties? Martin Honnen
3/31/2005 7:41:50 PM


[quoted text, click to view]

You can load and compile a schema and it has properties like Elements to
access the elements in the schema
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlSchemaXmlSchemaClassElementsTopic.asp>
and the SchemaTypes property for the types in the schema
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlSchemaXmlSchemaClassSchemaTypesTopic.asp>

--

Martin Honnen
AddThis Social Bookmark Button