HighTechTalks DotNet Forums  

XmlSchemaParticle.EmptyParticle

Dotnet XML microsoft.public.dotnet.xml


Discuss XmlSchemaParticle.EmptyParticle in the Dotnet XML forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
 
Posts: n/a

Default XmlSchemaParticle.EmptyParticle - 08-29-2007 , 11:10 AM






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.

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.