EDN Admin
Well-known member
Hi<br/>
<br/>
I have the following xsd (its WSDL) that I need to traverse,
http://social.msdn.microsoft.com/Forums/en-US/# <span style="font-family:Courier New; color:#ff0000 -
<span><span style="color:#0000ff <<span style="color:#990000 <span>s:complexType<span> name<span><span style="color:#0000ff =" UserSession <span style="color:#0000ff <span>"<span>>
<div style="text-indent:-2em http://social.msdn.microsoft.com/Forums/en-US/# <span style="font-family:Courier New; color:#ff0000 -
<span><span style="color:#0000ff <<span style="color:#990000 <span>s:complexContent<span> mixed<span><span style="color:#0000ff =" false <span style="color:#0000ff <span>"<span>>
<div style="text-indent:-2em http://social.msdn.microsoft.com/Forums/en-US/# <span style="font-family:Courier New; color:#ff0000 -
<span><span style="color:#0000ff <<span style="color:#990000 <span>s:extension<span> base<span><span style="color:#0000ff =" tns:EntityObject <span style="color:#0000ff <span>"<span>>
<div style="text-indent:-2em http://social.msdn.microsoft.com/Forums/en-US/# <span style="font-family:Courier New; color:#ff0000 -
<span><span style="color:#0000ff <<span><span style="color:#990000 s:sequence<span><span style="color:#0000ff >
<div style="text-indent:-2em <span> <span style="font-family:Courier New; color:#ff0000
<span><span style="color:#0000ff <<span><span style="color:#990000 s:element
<span><span style="color:#990000 minOccurs<span><span style="color:#0000ff =" 0 <span><span style="color:#0000ff "<span><span style="color:#990000 maxOccurs<span><span style="color:#0000ff =" 1 <span><span style="color:#0000ff "<span><span style="color:#990000
name<span><span style="color:#0000ff =" Name <span><span style="color:#0000ff "<span><span style="color:#990000 type<span><span style="color:#0000ff =" s:string <span style="color:#0000ff <span>"<span>
/>
<div style="text-indent:-2em <span> <span style="font-family:Courier New; color:#ff0000
<span><span style="color:#0000ff <<span><span style="color:#990000 s:element
<span><span style="color:#990000 minOccurs<span><span style="color:#0000ff =" 0 <span><span style="color:#0000ff "<span><span style="color:#990000 maxOccurs<span><span style="color:#0000ff =" 1 <span><span style="color:#0000ff "<span><span style="color:#990000
name<span><span style="color:#0000ff =" SessionType <span><span style="color:#0000ff "<span><span style="color:#990000 type<span><span style="color:#0000ff =" s:string <span style="color:#0000ff <span>"<span>
/>
<div style="text-indent:-2em <span> <span style="font-family:Courier New; color:#ff0000
<span><span style="color:#0000ff <<span><span style="color:#990000 s:element
<span><span style="color:#990000 minOccurs<span><span style="color:#0000ff =" 1 <span><span style="color:#0000ff "<span><span style="color:#990000 maxOccurs<span><span style="color:#0000ff =" 1 <span><span style="color:#0000ff "<span><span style="color:#990000
name<span><span style="color:#0000ff =" LoginTime <span><span style="color:#0000ff "<span><span style="color:#990000 type<span><span style="color:#0000ff =" s:dateTime <span style="color:#0000ff <span>"<span>
/>
<div style="text-indent:-2em <span> <span style="font-family:Courier New; color:#ff0000
<span><span style="color:#0000ff <<span><span style="color:#990000 s:element
<span><span style="color:#990000 minOccurs<span><span style="color:#0000ff =" 1 <span><span style="color:#0000ff "<span><span style="color:#990000 maxOccurs<span><span style="color:#0000ff =" 1 <span><span style="color:#0000ff "<span><span style="color:#990000
name<span><span style="color:#0000ff =" LogoutTime <span><span style="color:#0000ff "<span><span style="color:#990000 type<span><span style="color:#0000ff =" s:dateTime <span style="color:#0000ff <span>"<span>
/>
<div style="text-indent:-2em <span> <span style="font-family:Courier New; color:#ff0000 <span> <span style="font-family:Courier New; color:#ff0000
<span><span style="color:#0000ff </<span><span style="color:#990000 s:sequence<span><span style="color:#0000ff >
<span> <span style="font-family:Courier New; color:#ff0000
<span><span style="color:#0000ff </<span><span style="color:#990000 s:extension<span><span style="color:#0000ff >
<span> <span style="font-family:Courier New; color:#ff0000
<span><span style="color:#0000ff </<span><span style="color:#990000 s:complexContent<span><span style="color:#0000ff >
<span> <span style="font-family:Courier New; color:#ff0000
<span><span style="color:#0000ff </<span><span style="color:#990000 s:complexType<span><span style="color:#0000ff >
<span><span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small
Types
System.Xml.Schema.
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small types = serviceDescription.Types; // service description of WSDL
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchema<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
xmlSchema = types.Schemas[0];
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small foreach<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
(System.Xml.Schema.<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaComplexType<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
item <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small in<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
xmlSchema.SchemaTypes.Values){<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#008000; font-size:x-small <span style="font-family:Courier New; color:#008000; font-size:x-small <span style="font-family:Courier New; color:#008000; font-size:x-small //System.Xml.Schema.XmlSchemaParticle
particle = item.ContentTypeParticle;
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
System.Xml.Schema.
<span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaContentType<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
content = item.ContentType;<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaParticle<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
particle = item.ContentTypeParticle;<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaContentModel<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
model = item.ContentModel;<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small System.Xml.Schema.<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaComplexContent<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
complex = model <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small as<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
System.Xml.Schema.<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaComplexContent<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small ;<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; color:#008000; font-size:x-small <span style="font-family:Courier New; color:#008000; font-size:x-small <span style="font-family:Courier New; color:#008000; font-size:x-small //System.Xml.Schema.XmlSchemaComplexContentExtension
extension = complex.Content as System.Xml.Schema.XmlSchemaComplexContentExtension;
System.Xml.Schema.
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
System.Xml.Schema.
{
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
{
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaSequence<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
sequence = particle <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small as<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
System.Xml.Schema.<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaSequence<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small ;<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small if<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
(sequence != <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small null<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small )
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small foreach<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
(System.Xml.Schema.<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaElement<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
childElement <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small in<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
sequence.Items) <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small string<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
Name = childElement.Name;<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small string<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
Type = childElement.SchemaTypeName.Name;<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small Console<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small .WriteLine(Name
+ <span style="font-family:Courier New; color:#a31515; font-size:x-small <span style="font-family:Courier New; color:#a31515; font-size:x-small <span style="font-family:Courier New; color:#a31515; font-size:x-small " "<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
+ Type);
}
}
}
As you can see Ive tried using ContentModel (which is what MSDN resources said to use, I think) but its coming up null.
<br/>
I had to comment that out. I need to know what any complexType is composed of by traversing to its elementary composition.
<br/>
Thanks in advance.
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; color:#008000; font-size:x-small <span style="font-family:Courier New; color:#008000; font-size:x-small <span style="font-family:Courier New; color:#008000; font-size:x-small //System.Xml.Schema.XmlSchemaParticle
particle = extension.Particle;
System.Xml.Schema.
View the full article
<br/>
I have the following xsd (its WSDL) that I need to traverse,
http://social.msdn.microsoft.com/Forums/en-US/# <span style="font-family:Courier New; color:#ff0000 -
<span><span style="color:#0000ff <<span style="color:#990000 <span>s:complexType<span> name<span><span style="color:#0000ff =" UserSession <span style="color:#0000ff <span>"<span>>
<div style="text-indent:-2em http://social.msdn.microsoft.com/Forums/en-US/# <span style="font-family:Courier New; color:#ff0000 -
<span><span style="color:#0000ff <<span style="color:#990000 <span>s:complexContent<span> mixed<span><span style="color:#0000ff =" false <span style="color:#0000ff <span>"<span>>
<div style="text-indent:-2em http://social.msdn.microsoft.com/Forums/en-US/# <span style="font-family:Courier New; color:#ff0000 -
<span><span style="color:#0000ff <<span style="color:#990000 <span>s:extension<span> base<span><span style="color:#0000ff =" tns:EntityObject <span style="color:#0000ff <span>"<span>>
<div style="text-indent:-2em http://social.msdn.microsoft.com/Forums/en-US/# <span style="font-family:Courier New; color:#ff0000 -
<span><span style="color:#0000ff <<span><span style="color:#990000 s:sequence<span><span style="color:#0000ff >
<div style="text-indent:-2em <span> <span style="font-family:Courier New; color:#ff0000
<span><span style="color:#0000ff <<span><span style="color:#990000 s:element
<span><span style="color:#990000 minOccurs<span><span style="color:#0000ff =" 0 <span><span style="color:#0000ff "<span><span style="color:#990000 maxOccurs<span><span style="color:#0000ff =" 1 <span><span style="color:#0000ff "<span><span style="color:#990000
name<span><span style="color:#0000ff =" Name <span><span style="color:#0000ff "<span><span style="color:#990000 type<span><span style="color:#0000ff =" s:string <span style="color:#0000ff <span>"<span>
/>
<div style="text-indent:-2em <span> <span style="font-family:Courier New; color:#ff0000
<span><span style="color:#0000ff <<span><span style="color:#990000 s:element
<span><span style="color:#990000 minOccurs<span><span style="color:#0000ff =" 0 <span><span style="color:#0000ff "<span><span style="color:#990000 maxOccurs<span><span style="color:#0000ff =" 1 <span><span style="color:#0000ff "<span><span style="color:#990000
name<span><span style="color:#0000ff =" SessionType <span><span style="color:#0000ff "<span><span style="color:#990000 type<span><span style="color:#0000ff =" s:string <span style="color:#0000ff <span>"<span>
/>
<div style="text-indent:-2em <span> <span style="font-family:Courier New; color:#ff0000
<span><span style="color:#0000ff <<span><span style="color:#990000 s:element
<span><span style="color:#990000 minOccurs<span><span style="color:#0000ff =" 1 <span><span style="color:#0000ff "<span><span style="color:#990000 maxOccurs<span><span style="color:#0000ff =" 1 <span><span style="color:#0000ff "<span><span style="color:#990000
name<span><span style="color:#0000ff =" LoginTime <span><span style="color:#0000ff "<span><span style="color:#990000 type<span><span style="color:#0000ff =" s:dateTime <span style="color:#0000ff <span>"<span>
/>
<div style="text-indent:-2em <span> <span style="font-family:Courier New; color:#ff0000
<span><span style="color:#0000ff <<span><span style="color:#990000 s:element
<span><span style="color:#990000 minOccurs<span><span style="color:#0000ff =" 1 <span><span style="color:#0000ff "<span><span style="color:#990000 maxOccurs<span><span style="color:#0000ff =" 1 <span><span style="color:#0000ff "<span><span style="color:#990000
name<span><span style="color:#0000ff =" LogoutTime <span><span style="color:#0000ff "<span><span style="color:#990000 type<span><span style="color:#0000ff =" s:dateTime <span style="color:#0000ff <span>"<span>
/>
<div style="text-indent:-2em <span> <span style="font-family:Courier New; color:#ff0000 <span> <span style="font-family:Courier New; color:#ff0000
<span><span style="color:#0000ff </<span><span style="color:#990000 s:sequence<span><span style="color:#0000ff >
<span> <span style="font-family:Courier New; color:#ff0000
<span><span style="color:#0000ff </<span><span style="color:#990000 s:extension<span><span style="color:#0000ff >
<span> <span style="font-family:Courier New; color:#ff0000
<span><span style="color:#0000ff </<span><span style="color:#990000 s:complexContent<span><span style="color:#0000ff >
<span> <span style="font-family:Courier New; color:#ff0000
<span><span style="color:#0000ff </<span><span style="color:#990000 s:complexType<span><span style="color:#0000ff >
<span><span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small
Types
System.Xml.Schema.
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small types = serviceDescription.Types; // service description of WSDL
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchema<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
xmlSchema = types.Schemas[0];
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small foreach<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
(System.Xml.Schema.<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaComplexType<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
item <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small in<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
xmlSchema.SchemaTypes.Values){<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#008000; font-size:x-small <span style="font-family:Courier New; color:#008000; font-size:x-small <span style="font-family:Courier New; color:#008000; font-size:x-small //System.Xml.Schema.XmlSchemaParticle
particle = item.ContentTypeParticle;
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
System.Xml.Schema.
<span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaContentType<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
content = item.ContentType;<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaParticle<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
particle = item.ContentTypeParticle;<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaContentModel<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
model = item.ContentModel;<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small System.Xml.Schema.<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaComplexContent<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
complex = model <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small as<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
System.Xml.Schema.<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaComplexContent<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small ;<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; color:#008000; font-size:x-small <span style="font-family:Courier New; color:#008000; font-size:x-small <span style="font-family:Courier New; color:#008000; font-size:x-small //System.Xml.Schema.XmlSchemaComplexContentExtension
extension = complex.Content as System.Xml.Schema.XmlSchemaComplexContentExtension;
System.Xml.Schema.
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
System.Xml.Schema.
{
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
{
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaSequence<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
sequence = particle <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small as<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
System.Xml.Schema.<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaSequence<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small ;<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small if<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
(sequence != <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small null<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small )
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small foreach<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
(System.Xml.Schema.<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small XmlSchemaElement<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
childElement <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small in<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
sequence.Items) <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small string<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
Name = childElement.Name;<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small <span style="font-family:Courier New; color:#0000ff; font-size:x-small string<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
Type = childElement.SchemaTypeName.Name;<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; font-size:x-small
<span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small <span style="font-family:Courier New; color:#2b91af; font-size:x-small Console<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small .WriteLine(Name
+ <span style="font-family:Courier New; color:#a31515; font-size:x-small <span style="font-family:Courier New; color:#a31515; font-size:x-small <span style="font-family:Courier New; color:#a31515; font-size:x-small " "<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; font-size:x-small
+ Type);
}
}
}
As you can see Ive tried using ContentModel (which is what MSDN resources said to use, I think) but its coming up null.
<br/>
I had to comment that out. I need to know what any complexType is composed of by traversing to its elementary composition.
<br/>
Thanks in advance.
<span style="font-family:Courier New; font-size:x-small <span style="font-family:Courier New; color:#008000; font-size:x-small <span style="font-family:Courier New; color:#008000; font-size:x-small <span style="font-family:Courier New; color:#008000; font-size:x-small //System.Xml.Schema.XmlSchemaParticle
particle = extension.Particle;
System.Xml.Schema.
View the full article