Hi
I'm currently trying to create a dataset from an xml schema (.xsd).
(I'm unable to use XSD.exe due to the format of our xml).
I have come across a problem while traversing down the schema tree.
When I encounter an XmlSchemaComplexType I want to detect if the Particle or ContentParticleType = EmptyParticle.
However, I am unable to do this due to EmptyParticle being an internal class to XmlSchemaParticle.
Comparing it with null doesn't work - because the EmptyParticle is not the same as null.
Can anyone point me in the right direction to get this snippet of code to work correctly ?
XmlSchemaComplexType ct; // This is assigned a valid object elsewhere
if (ct.Particle != XmlSchemaParticle.EmptyParticle || ct.ContentTypeParticle != null)
{
XmlSchemaParticle p = ct.Particle;
if (ct.ContentTypeParticle != null)
{
p = ct.ContentTypeParticle;
}
}
Cheers
--
Ged Moretta
Senior Software Engineer
AppSense Ltd
www.appsense.com
-----------------------------------------------------------------------
This signature isn't automatic. I have to type it manually every time.