Once you have read a XSD Schema in to the XmlSchema object and called
Compile(), you can access all top level elements through XmlSchema.Elements
collection with contains instance of XmlSchemaElement objects. You can
access all top level types by XmlSchema.SchemaTypes.
If you want the type of a particular element, use the
XmlSchemaElement.ElementType property.
[quoted text, click to view] "SideByEach" <knight2@nb.sympatico.ca> wrote in message
news:1118426740.926915.104320@z14g2000cwz.googlegroups.com...
> If I wanted to find the type referenced in this XML's root node, what
> object would I use in the SOM?
>
> <xs:schema
> xmlns="
http://www.w3.org/1999/XSL/Transform"elementFormDefault="qualified" >
>
targetNamespace="
http://www.w3.org/1999/XSL/Transform"xmlns:xs="
http://www.w 3.org/2001/XMLSchema"
[quoted text, click to view] >
> xmlns:vs="
http://schemas.microsoft.com/Visual-Studio-Intellisense"> >
> <xs:group name="persongroup">
> <xs:sequence>
> <xs:element name="firstname" type="xs:string"/>
> <xs:element name="lastname" type="xs:string"/>
> <xs:element name="birthday" type="xs:date"/>
> </xs:sequence>
> </xs:group>
>
> <xs:element name="person" type="personinfo"/>
>
> <xs:complexType name="personinfo">
> <xs:sequence>
> <xs:group ref="persongroup"/>
> <xs:element name="country" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> </xs:schema>
>
> Note that "personinfo" doesn't to live anywhere in the MS SOM (SOM =
> System.Xml.Schema.XmlSchema).
>
> Thanks
>