472,982 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,982 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 1713
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.