473,387 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Reading a COMPLEX CONTENT : Stan Can you help?

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>
***********************
Jan 12 '06 #1
4 1737
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>
***********************

Jan 12 '06 #2
Hi Stan,
Thanks for the reply.It works well. Basically, I am reading the XSD file and
representing the XSD in a Tree View (with nodes of all the elements) in a
..NET application. The problem that I have now is that the Tree works well but
the nodes do not appear in the same order as they appear in the XSD file.
They are in any order. Do you know I could solve this?. I am creating the
nodes in the same way that you have the "recursive" calling of the "WalkThe
Particle" sub.

Thanks for your time.
Ganesh
"Stan Kitsis [MSFT]" wrote:
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>
***********************


Jan 13 '06 #3
I'm not sure what you're saying. Are the globals not ordered properly or
are you saying elements in a sequence are randomly ordered?

--
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:C8**********************************@microsof t.com...
Hi Stan,
Thanks for the reply.It works well. Basically, I am reading the XSD file
and
representing the XSD in a Tree View (with nodes of all the elements) in a
.NET application. The problem that I have now is that the Tree works well
but
the nodes do not appear in the same order as they appear in the XSD file.
They are in any order. Do you know I could solve this?. I am creating the
nodes in the same way that you have the "recursive" calling of the
"WalkThe
Particle" sub.

Thanks for your time.
Ganesh
"Stan Kitsis [MSFT]" wrote:
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>
> ***********************


Jan 17 '06 #4
If I draw a tree with all the nodes (for each element), the tree does not
represent the XSD in the same order as they appear in the actual file. The
elements are are in random.

Thanks,
Ganesh

"Stan Kitsis [MSFT]" wrote:
I'm not sure what you're saying. Are the globals not ordered properly or
are you saying elements in a sequence are randomly ordered?

--
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:C8**********************************@microsof t.com...
Hi Stan,
Thanks for the reply.It works well. Basically, I am reading the XSD file
and
representing the XSD in a Tree View (with nodes of all the elements) in a
.NET application. The problem that I have now is that the Tree works well
but
the nodes do not appear in the same order as they appear in the XSD file.
They are in any order. Do you know I could solve this?. I am creating the
nodes in the same way that you have the "recursive" calling of the
"WalkThe
Particle" sub.

Thanks for your time.
Ganesh
"Stan Kitsis [MSFT]" wrote:
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>
> ***********************


Jan 17 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: infinull | last post by:
I am making a script that is a very complex Content Management system. it makes a UDM navigation bar and writes content and a title. i want it to write content other that just basic text, like a...
0
by: AL | last post by:
Hello, working on an xsd schema, I'd like it to have a node of which I don't know the content at design time: I want the document instance to identify such node contents, where content should have...
13
by: Dennis M. Straussfogel | last post by:
I'm trying to validate a page that begins with: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.did> <html> <head> <meta...
0
by: philip20060308 | last post by:
Hi all, Has anyone ever seen Python 2.4.1's httplib choke when reading chunked content? I'm using it via urrlib2, and I ran into a particular server that returns something that httplib doesn't...
2
by: Paul Hale | last post by:
Hi, I have a c# application that I would like to read in a “somewebsite.url” file and extract the “Web document URL:” property for use in my app. Can anybody give me any pointers on how...
4
by: Vikas Kumar | last post by:
propertyDescription += "<br>" + lblpropertyDescription.Text; //here i am reading some text from text area i test wrting "p" in my text area it wrks fine but when i write <pin my text...
1
by: CodeSeeker | last post by:
I have an application, which uses pop3 to read the messages from the mailbox, and it has been working fine for so many year. We recently have started changing this application to use java mail IMAP 4...
5
by: Nathan Sokalski | last post by:
I have css that would normally be placed in style tags in the header of the Master page that I want to add programmatically for a specific Web Content Form (the *.aspx page). How do I do this for a...
5
by: Justin | last post by:
Here's my XML: <?xml version="1.0" ?> <AppMode Type="Network"> <CurrentFolder Path="c:\tabs"> <Tabs> <FilePath>tabs\Justin.tab</FilePath> <FilePath>tabs\Julie.tab</FilePath> *****There could...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.