Ganesh,
Try this:
XmlSchemaType type;
// type = ...
if (type is XmlSchemaComplexType)
{
XmlSchemaComplexType ct = type as XmlSchemaComplexType;
if (ct.ContentModel is XmlSchemaSimpleContent)
{
// simple content processing
}
else
{
if (ct.ContentModel is XmlSchemaComplexContent)
{
// complex content processing
}
// particle processing
XmlSchemaParticle particle = null;
if (ct.ContentModel == null)
particle = ct.Particle;
else
{
if (ct.ContentModel.Content is XmlSchemaComplexContentExtension)
{
XmlSchemaComplexContentExtension xscce =
ct.ContentModel.Content as XmlSchemaComplexContentExtension;
particle = xscce.Particle;
}
else if (ct.ContentModel.Content is
XmlSchemaComplexContentRestriction)
{
XmlSchemaComplexContentRestriction xsccr =
ct.ContentModel.Content as XmlSchemaComplexContentRestriction;
particle = xsccr.Particle;
}
}
// particle processing code
}
}
--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Ganesh Muthuvelu" <Ga*************@discussions.microsoft.com> wrote in
message news:B2**********************************@microsof t.com...
Hi STAN,
Stan: Thanks for your response to my previous post on reading a XSD file
using your article in
"https://blogs.msdn.com/stan_kitsis/archive/2005/08/06/448572.aspx".
it works quite well but I have one problem.. I am not able to read a
Complex
Content.. Here is a portion of the XSD that contains the complex content.
I
need to read the elements under it and could not get an handle to it..
Could you please help?
Thanks,
Ganesh
***********************
<xs:complexType name="UserBasic">
<xs:complexContent mixed="false">
<xs:extension base="core:OCIDataResponse">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="placed"
type="BasicLogEntry" />
<xs:element minOccurs="0" maxOccurs="unbounded" name="received"
type="BasicLogEntry" />
<xs:element minOccurs="0" maxOccurs="unbounded" name="missed"
type="BasicLogEntry" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
***********************