Worked great - thanks.
I assume from the documentation when I see this that I ignore the properties
in the initial element (except for min/max/id if set) and instead the
reference is the element at this position and the reference then gives me any
attributes and child elements???

Signature
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
> >I have an xsd:
> > <xsd:element name="comment" type="xsd:string">
[quoted text clipped - 21 lines]
> ref can only refer to global elements. You only need to look at the
> XmlSchemaSet.GlobalElements collection to see the possible root elements.
WenYuan Wang [MSFT] - 03 Jul 2007 11:17 GMT
Hello Dave
Thanks for John's idea.
XmlSchemaSet.GlobalElements is the best way to search the reference.
The schema you posted in newsgroup is equal to
<xsd:complexType name="PurchaseOrderType">
<xsd:sequence>
<xsd:element name="shipTo" type="USAddress"/>
<xsd:element name="billTo" type="USAddress"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>hi there</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="items" type="Items"/>
</xsd:sequence>
<xsd:attribute name="orderDate" type="xsd:date"/>
</xsd:complexType>
If you get the reference, it will tell you all child element and
attributes. However, please don't forget the attribute in the initial
element. (such as the minOccurs="0" in the current case)
Hope this helps.
Sincerley,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.